Panel Interface Board  1
inszt_app.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:19:40 2020
5 */
6 
7 /**************************************************************************************/
24 /**************************************************************************************/
25 /**************************************************************************************/
26 /**************************************************************************************/
27 /* Section: Included Files */
28 /**************************************************************************************/
29 /**************************************************************************************/
30 #include <stdint.h>
31 #include <stdbool.h>
32 #include <stddef.h>
33 #include <stdlib.h>
34 #define QQQdialect MPLABX
35 #undef QQQ146
36 #undef QQQ148
37 #undef QQQbndchk
38 #undef QQQ294
39 #undef QQQEMBEDDEDICE
40  /* Note: for BITMAP execution histories QQQthreaded is not defined */
41 #undef QQQthreaded
42 #undef QQQdo178b
43 #undef QQQfixbra
44 #define QQQswitch3
45 #undef QQQternary
46 #undef QQQswitch
47 #undef QQQmacrof
48 #undef QQQMULTIPROCESSEXH
49 #undef QQFLUSH
50 #undef QQNEWBS
51 #define qqqMaxBranchDepth 20
52 #define QQQstructbitmap
53  static int qqqqbmselwidth = 32 ;
54  static int zzfileid = 64;
55 #define QQQnumfil 23
56 #undef QQQALGONE
57 #undef QQQVCLFLG
58 #undef QQQFORKFL
59 #undef QQQIADDRF
60 #undef QQQRTI
61 #undef QQQPERFA
62 #undef QQQADRMOD
63 #undef QQQDCAPFL
64 #undef QQQTEMPLATEONLY
65 #define QQQNOATEXIT
66 #define QQQUPLOADATEND
67 #define QQQNOSTDIO
68 #undef QQQASHLINGVITRA
69 #define QQQBITMAP
70  #define qqqbitmapint unsigned int
71 #undef QQQBITMAPMCDC
72 #undef QQQTIC2XSERIALIO
73 #undef QQQTIC2XFLASH
74 #undef QQQCOMPRESSED_EXH
75 #undef QQQMAINFL
76 #define QQQSINGLEFILE
77 #define QQQFILEID
78 #define QQQseparate
79 extern int QQQindicator;
80 static int QQQfirstmcdc=1;
81 #define app_64zzopen zzopen
82  extern int app_64zzopen ;
83 #define app_64zqqzqz1 zqqzqz1
84 #define QQQLDRA_PORT
85 #ifndef QQQLDRA_PORT
86 #define FILEPOINT FILE * f,
87 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
88 #include <stdio.h>
89  /* ----------------------------------------------------------------------* 100 *
90  * If stdio.h is not available then insert:
91  * typedef int * FILE;
92  * -----------------------------------------------------------------------------
93  */
94 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
95 #else /* QQQLDRA_PORT */
96 #define FILEPOINT
97 /*************************** LDRA_PORT *********************************/
98 #ifdef QQQ_SHLAYOUT
99 static int tbrun_mode=1;
100 #else
101 static int tbrun_mode=0;
102 #endif /* QQQ_SHLAYOUT */
103 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
104 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
105 #ifndef QQQ_SHLAYOUT
106 #ifdef QQQMAINFL
107 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
108 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
109 #endif /* QQQMAINFL */
110 #endif /* QQQ_SHLAYOUT */
111 /************************ END OF LDRA_PORT *****************************/
112 #endif /* QQQLDRA_PORT */
113 #ifndef QQQnumfil
114 #define QQQnumfil 40 /* default setting */
115 #endif /* QQQnumfil */
116 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
117 #ifndef LDRA_VOID_FUNC
118 #define LDRA_VOID_FUNC
119  typedef void(*ldra_void_function)();
120 #endif
121 #if defined(QQQMAINFL)
122  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
123  through the target you would have to set this to 0 before calling the qqqupload.
124  Move this into ldra_port mechanism. */
125  int qqqshell_upload = 0;
126  int QQQfcn_ptr_num = 0;
127  static int qqqisinitialised = 0;
130  void qqqtotalupload(void);
131  void qqqtotalreset(void);
133  qqqaccumupload[x]=y;
134  qqqaccumreset[x]=z;
135  QQQfcn_ptr_num++;
136  }
137 #else /* (QQQMAINFL) */
138  extern int QQQfcn_ptr_num;
141  static int qqqstructzzopen = 0;
142 #endif /* defined(QQQMAINFL) */
143 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
144 #ifdef QQQ_KEEPCOMMENTS
145  /* -----------------------------------------------------------------------* 101 *
146  * Special settings for systems lacking standard functions.
147  * To include code for fprintf define ldra_fprintf
148  * To include code for sscanf define ldra_sscanf
149  * -----------------------------------------------------------------------------
150  */
151 #endif /* QQQ_KEEPCOMMENTS */
152 #if !defined(QQQSUPPRESS_UNDEF)
153 #undef ldra_fprintf
154 #undef ldra_sscanf
155 #endif /* !defined(QQQSUPPRESS_UNDEF) */
156  /* #define ldra_fprintf */
157  /* #define ldra_sscanf */
158 #undef QQQHITMAP_STORAGE
159 #undef qqnull_params
160 #define qqnull_params void
161 #define QQQ_PROTOTYPE_DEF
162  /* Conventional Instrumentation */
163 #undef QQ_ANSI_PROTOTYPE
164 #ifdef __STDC__
165 #define QQ_ANSI_PROTOTYPE 1
166 #else /* __STDC__ */
167 #ifdef VAXC
168 #define QQ_ANSI_PROTOTYPE 1
169 #endif /* VAXC */
170 #endif /* __STDC__ */
171  static unsigned char qqqzzglobflag = 0;
172  static struct bitmapstruct_t
173  {
174 #define ELEMENT(N) qqqbitmapint element##N;
175 #define LASTELEMENT
176 #include "app_64zbelem.def"
177 #undef ELEMENT
178 #undef LASTELEMENT
179  } bitmapstruct = {
180 #define ELEMENT(N) 0,
181 #undef LASTELEMENT
182 #include "app_64zbelem.def"
183 #undef ELEMENT
184  0};
185  static void qqoutput(FILEPOINT char * s,int i);
186  static void qqoutput2(FILEPOINT char * s,int i, int j);
187  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
188  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
189  static void qqoutput0(FILEPOINT char * s);
190  static int app_64zqqzqz(qqnull_params);
191  static int app_64zqqzqz1(qqnull_params);
192  static int app_64zqendz (int qqqi);
193  static int app_64zqzqzq (int qqqi);
194  static void qqqupload(qqnull_params);
195  static void qqqbitmapreset(qqnull_params);
196 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
197 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
198 /*******************************************************************************
199  MPLAB Harmony System Configuration Header
200  File Name:
201  system_config.h
202  Summary:
203  Build-time configuration header for the system defined by this MPLAB Harmony
204  project.
205  Description:
206  An MPLAB Project may have multiple configurations. This file defines the
207  build-time options for a single configuration.
208  Remarks:
209  This configuration header must not define any prototypes or data
210  definitions (or include any files that do). It only provides macro
211  definitions for build-time configuration options that are not instantiated
212  until used by another MPLAB Harmony module or application.
213  Created with MPLAB Harmony Version 2.06
214 *******************************************************************************/
215 // DOM-IGNORE-BEGIN
216 /*******************************************************************************
217 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
218 Microchip licenses to you the right to use, modify, copy and distribute
219 Software only when embedded on a Microchip microcontroller or digital signal
220 controller that is integrated into your product or third party product
221 (pursuant to the sublicense terms in the accompanying license agreement).
222 You should refer to the license agreement accompanying this Software for
223 additional information regarding your rights and obligations.
224 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
225 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
226 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
227 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
228 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
229 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
230 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
231 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
232 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
233 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
234 *******************************************************************************/
235 // DOM-IGNORE-END
236 #ifndef _SYSTEM_CONFIG_H
237 #define _SYSTEM_CONFIG_H
238 // *****************************************************************************
239 // *****************************************************************************
240 // Section: Included Files
241 // *****************************************************************************
242 // *****************************************************************************
243 /* This section Includes other configuration headers necessary to completely
244  define this configuration.
245 */
246 // DOM-IGNORE-BEGIN
247 // DOM-IGNORE-END
248 // *****************************************************************************
249 // *****************************************************************************
250 // Section: System Service Configuration
251 // *****************************************************************************
252 // *****************************************************************************
253 // *****************************************************************************
254 /* Common System Service Configuration Options
255 */
256 #define SYS_VERSION_STR "2.06"
257 #define SYS_VERSION 20600
258 // *****************************************************************************
259 /* Clock System Service Configuration Options
260 */
261 #define SYS_CLK_FREQ 200000000ul
262 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
263 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
264 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
265 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
266 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
267 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
268 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
269 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
270 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
271 /*** Ports System Service Configuration ***/
272 #define SYS_PORT_A_ANSEL 0x3F00
273 #define SYS_PORT_A_TRIS 0xFFED
274 #define SYS_PORT_A_LAT 0x0010
275 #define SYS_PORT_A_ODC 0x0000
276 #define SYS_PORT_A_CNPU 0x0020
277 #define SYS_PORT_A_CNPD 0x0000
278 #define SYS_PORT_A_CNEN 0x0021
279 #define SYS_PORT_B_ANSEL 0x10C8
280 #define SYS_PORT_B_TRIS 0x91FF
281 #define SYS_PORT_B_LAT 0x0000
282 #define SYS_PORT_B_ODC 0x0000
283 #define SYS_PORT_B_CNPU 0x0000
284 #define SYS_PORT_B_CNPD 0x0000
285 #define SYS_PORT_B_CNEN 0x0000
286 #define SYS_PORT_C_ANSEL 0xCFE1
287 #define SYS_PORT_C_TRIS 0xFFFF
288 #define SYS_PORT_C_LAT 0x0000
289 #define SYS_PORT_C_ODC 0x0000
290 #define SYS_PORT_C_CNPU 0x0000
291 #define SYS_PORT_C_CNPD 0x0000
292 #define SYS_PORT_C_CNEN 0x0000
293 #define SYS_PORT_D_ANSEL 0xC100
294 #define SYS_PORT_D_TRIS 0xFFFF
295 #define SYS_PORT_D_LAT 0x0000
296 #define SYS_PORT_D_ODC 0x0000
297 #define SYS_PORT_D_CNPU 0x0000
298 #define SYS_PORT_D_CNPD 0x0000
299 #define SYS_PORT_D_CNEN 0x0000
300 #define SYS_PORT_E_ANSEL 0xFC00
301 #define SYS_PORT_E_TRIS 0xFDFF
302 #define SYS_PORT_E_LAT 0x0000
303 #define SYS_PORT_E_ODC 0x0000
304 #define SYS_PORT_E_CNPU 0x0000
305 #define SYS_PORT_E_CNPD 0x0000
306 #define SYS_PORT_E_CNEN 0x0000
307 #define SYS_PORT_F_ANSEL 0xCEC0
308 #define SYS_PORT_F_TRIS 0xEFFF
309 #define SYS_PORT_F_LAT 0x0000
310 #define SYS_PORT_F_ODC 0x0000
311 #define SYS_PORT_F_CNPU 0x0000
312 #define SYS_PORT_F_CNPD 0x0000
313 #define SYS_PORT_F_CNEN 0x0000
314 #define SYS_PORT_G_ANSEL 0x8CBC
315 #define SYS_PORT_G_TRIS 0xDFFF
316 #define SYS_PORT_G_LAT 0x0000
317 #define SYS_PORT_G_ODC 0x0000
318 #define SYS_PORT_G_CNPU 0x0000
319 #define SYS_PORT_G_CNPD 0x0000
320 #define SYS_PORT_G_CNEN 0x0000
321 #define SYS_PORT_H_ANSEL 0x0070
322 #define SYS_PORT_H_TRIS 0xB3FB
323 #define SYS_PORT_H_LAT 0x0000
324 #define SYS_PORT_H_ODC 0x0000
325 #define SYS_PORT_H_CNPU 0x0000
326 #define SYS_PORT_H_CNPD 0x0000
327 #define SYS_PORT_H_CNEN 0x0000
328 #define SYS_PORT_J_ANSEL 0x0000
329 #define SYS_PORT_J_TRIS 0x8B7F
330 #define SYS_PORT_J_LAT 0x0080
331 #define SYS_PORT_J_ODC 0x0000
332 #define SYS_PORT_J_CNPU 0x0000
333 #define SYS_PORT_J_CNPD 0x0000
334 #define SYS_PORT_J_CNEN 0x0800
335 #define SYS_PORT_K_ANSEL 0xFF00
336 #define SYS_PORT_K_TRIS 0xFFFF
337 #define SYS_PORT_K_LAT 0x0000
338 #define SYS_PORT_K_ODC 0x0000
339 #define SYS_PORT_K_CNPU 0x0000
340 #define SYS_PORT_K_CNPD 0x0000
341 #define SYS_PORT_K_CNEN 0x0000
342 /*** Interrupt System Service Configuration ***/
343 #define SYS_INT true
344 /*** Timer System Service Configuration ***/
345 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
346 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
347 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
348 #define SYS_TMR_FREQUENCY 1000
349 #define SYS_TMR_FREQUENCY_TOLERANCE 10
350 #define SYS_TMR_UNIT_RESOLUTION 10000
351 #define SYS_TMR_CLIENT_TOLERANCE 10
352 #define SYS_TMR_INTERRUPT_NOTIFICATION false
353 // *****************************************************************************
354 // *****************************************************************************
355 // Section: Driver Configuration
356 // *****************************************************************************
357 // *****************************************************************************
358 #define DRV_IC_DRIVER_MODE_STATIC
359 #define USE_8BIT_PMP
360 /*** SPI Driver Configuration ***/
361 #define DRV_SPI_NUMBER_OF_MODULES 6
362 /*** Driver Compilation and static configuration options. ***/
363 /*** Select SPI compilation units.***/
364 #define DRV_SPI_POLLED 1
365 #define DRV_SPI_ISR 0
366 #define DRV_SPI_MASTER 1
367 #define DRV_SPI_SLAVE 0
368 #define DRV_SPI_RM 0
369 #define DRV_SPI_EBM 1
370 #define DRV_SPI_8BIT 1
371 #define DRV_SPI_16BIT 1
372 #define DRV_SPI_32BIT 0
373 #define DRV_SPI_DMA 0
374 /*** SPI Driver Static Allocation Options ***/
375 #define DRV_SPI_INSTANCES_NUMBER 3
376 #define DRV_SPI_CLIENTS_NUMBER 3
377 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
378 /* SPI Driver Instance 0 Configuration */
379 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
380 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
381 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
382 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
383 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
384 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
385 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
386 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
387 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
388 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
389 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
390 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
391 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
392 #define DRV_SPI_BAUD_RATE_IDX0 1000000
393 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
394 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
395 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
396 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
397 #define DRV_SPI_QUEUE_SIZE_IDX0 10
398 #define DRV_SPI_RESERVED_JOB_IDX0 1
399 /* SPI Driver Instance 1 Configuration */
400 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
401 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
402 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
403 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
404 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
405 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
406 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
407 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
408 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
409 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
410 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
411 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
412 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
413 #define DRV_SPI_BAUD_RATE_IDX1 1000000
414 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
415 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
416 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
417 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
418 #define DRV_SPI_QUEUE_SIZE_IDX1 10
419 #define DRV_SPI_RESERVED_JOB_IDX1 1
420 /* SPI Driver Instance 2 Configuration */
421 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
422 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
423 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
424 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
425 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
426 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
427 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
428 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
429 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
430 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
431 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
432 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
433 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
434 #define DRV_SPI_BAUD_RATE_IDX2 500000
435 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
436 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
437 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
438 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
439 #define DRV_SPI_QUEUE_SIZE_IDX2 10
440 #define DRV_SPI_RESERVED_JOB_IDX2 1
441 /*** Timer Driver Configuration ***/
442 #define DRV_TMR_INTERRUPT_MODE true
443 /*** Timer Driver 0 Configuration ***/
444 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
445 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
446 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
447 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
448 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
449 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
450 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
451 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
452 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
453 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
454 #define DRV_TMR_POWER_STATE_IDX0
455 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
456 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
457 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
458 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
459 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
460 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
461 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
462 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
463 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
464 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
465 #define DRV_TMR_POWER_STATE_IDX1
466 /*** Timer Driver 2 Configuration ***/
467 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
468 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
469 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
470 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
471 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
472 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
473 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
474 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
475 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
476 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
477 #define DRV_TMR_POWER_STATE_IDX2
478 /*** Timer Driver 3 Configuration ***/
479 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
480 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
481 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
482 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
483 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
484 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
485 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
486 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
487 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
488 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
489 #define DRV_TMR_POWER_STATE_IDX3
490 /*** Timer Driver 4 Configuration ***/
491 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
492 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
493 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
494 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
495 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
496 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
497 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
498 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
499 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
500 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
501 #define DRV_TMR_POWER_STATE_IDX4
502  // *****************************************************************************
503 /* USART Driver Configuration Options
504 */
505 #define DRV_USART_INSTANCES_NUMBER 1
506 #define DRV_USART_CLIENTS_NUMBER 1
507 #define DRV_USART_INTERRUPT_MODE false
508 #define DRV_USART_BYTE_MODEL_SUPPORT true
509 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
510 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
511 // *****************************************************************************
512 // *****************************************************************************
513 // Section: Middleware & Other Library Configuration
514 // *****************************************************************************
515 // *****************************************************************************
516 /*** USB Driver Configuration ***/
517 /* Enables Device Support */
518 #define DRV_USBHS_DEVICE_SUPPORT true
519 /* Disable Host Support */
520 #define DRV_USBHS_HOST_SUPPORT false
521 /* Maximum USB driver instances */
522 #define DRV_USBHS_INSTANCES_NUMBER 1
523 /* Interrupt mode enabled */
524 #define DRV_USBHS_INTERRUPT_MODE true
525 /* Number of Endpoints used */
526 #define DRV_USBHS_ENDPOINTS_NUMBER 2
527 /*** USB Device Stack Configuration ***/
528 /* The USB Device Layer will not initialize the USB Driver */
529 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
530 /* Maximum device layer instances */
531 #define USB_DEVICE_INSTANCES_NUMBER 1
532 /* EP0 size in bytes */
533 #define USB_DEVICE_EP0_BUFFER_SIZE 64
534 /* Endpoint Transfer Queue Size combined for Read and write */
535 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
536 // *****************************************************************************
537 // *****************************************************************************
538 // Section: Application Configuration
539 // *****************************************************************************
540 // *****************************************************************************
541 /*** Application Defined Pins ***/
542 /*** Functions for LED1 pin ***/
543 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
544 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
545 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
546 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
547 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
548 /*** Functions for LED2 pin ***/
549 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
550 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
551 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
552 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
553 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
554 /*** Functions for DMP_FIRE_LED pin ***/
555 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
556 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
557 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
558 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
559 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
560 /*** Functions for HVPS_ENB pin ***/
561 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
562 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
563 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
564 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
565 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
566 /*** Functions for RLY_HVPS_OUT pin ***/
567 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
568 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
569 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
570 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
571 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
572 /*** Functions for RLY_WL_SPS_POL pin ***/
573 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
574 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
575 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
576 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
577 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
578 /*** Functions for RLY_LOG pin ***/
579 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
580 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
581 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
582 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
583 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
584 /*** Functions for RLY_DMP_FIRE pin ***/
585 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
586 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
587 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
588 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
589 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
590 /*** Functions for RLY_AUX pin ***/
591 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
592 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
593 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
594 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
595 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
596 /*** Functions for RLY_CCL pin ***/
597 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
598 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
599 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
600 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
601 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
602 /*** Functions for RLY_WL_MON pin ***/
603 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
604 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
605 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
606 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
607 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
608 /*** Functions for RLY_ARMCF pin ***/
609 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
610 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
611 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
612 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
613 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
614 /*** Functions for RLY_ARM pin ***/
615 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
616 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
617 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
618 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
619 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
620 /*** Functions for TPAN1 pin ***/
621 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
622 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
623 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
624 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
625 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
626 /*** Functions for TPAN2 pin ***/
627 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
628 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
629 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
630 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
631 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
632 /*** Functions for FSK_DAC_CS pin ***/
633 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
634 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
635 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
636 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
637 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
638 /*** Functions for RLY_COMM pin ***/
639 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
640 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
641 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
642 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
643 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
644 /*** Functions for FSK_DAC_CLR pin ***/
645 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
646 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
647 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
648 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
649 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
650 /*** Functions for WL_CPS_SW pin ***/
651 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
652 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
653 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
654 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
655 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
656 /*** Functions for HVPS_SW pin ***/
657 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
658 /*** Functions for MAN_SIG pin ***/
659 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
660 /*** Functions for DMP_FIRE_SW pin ***/
661 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
662 /*** Functions for NEG_SW pin ***/
663 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
664 /*** Functions for POS_SW pin ***/
665 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
666 /*** Functions for DRUM1_SW pin ***/
667 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
668 /*** Functions for SAFE_SW pin ***/
669 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
670 /*** Functions for DRUM2_SW pin ***/
671 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
672 /*** Functions for LOG_SW pin ***/
673 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
674 /*** Functions for AUX_SW pin ***/
675 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
676 /*** Functions for ARMCF_SW pin ***/
677 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
678 /*** Functions for ARM_SW pin ***/
679 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
680 /*** Functions for ARMCF_AUTO_SW pin ***/
681 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
682 /*** Functions for FIRE_SW_OFF pin ***/
683 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
684 /*** Functions for FIRE_SW_ON pin ***/
685 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
686 /*** Functions for WL_SPS_POS_DET pin ***/
687 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
688 /*** Functions for WL_SPS_NEG_DET pin ***/
689 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
690 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
691 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
692 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
693 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
694 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
695 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
696 /*** Application Instance 0 Configuration ***/
697 //DOM-IGNORE-BEGIN
698 //DOM-IGNORE-END
699  // _SYSTEM_CONFIG_H
700 /*******************************************************************************
701  End of File
702 */
703 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
704 /* CLOSE_FILE Include File */
705 
706 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
707 /*******************************************************************************
708  System Definitions
709  File Name:
710  system_definitions.h
711  Summary:
712  MPLAB Harmony project system definitions.
713  Description:
714  This file contains the system-wide prototypes and definitions for an MPLAB
715  Harmony project.
716  *******************************************************************************/
717 //DOM-IGNORE-BEGIN
718 /*******************************************************************************
719 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
720 Microchip licenses to you the right to use, modify, copy and distribute
721 Software only when embedded on a Microchip microcontroller or digital signal
722 controller that is integrated into your product or third party product
723 (pursuant to the sublicense terms in the accompanying license agreement).
724 You should refer to the license agreement accompanying this Software for
725 additional information regarding your rights and obligations.
726 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
727 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
728 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
729 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
730 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
731 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
732 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
733 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
734 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
735 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
736  *******************************************************************************/
737 //DOM-IGNORE-END
738 #ifndef _SYS_DEFINITIONS_H
739 #define _SYS_DEFINITIONS_H
740 // *****************************************************************************
741 // *****************************************************************************
742 // Section: Included Files
743 // *****************************************************************************
744 // *****************************************************************************
745 #include <stdint.h>
746 #include <stddef.h>
747 #include <stdbool.h>
748 #include "system/common/sys_common.h"
749 #include "system/common/sys_module.h"
750 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
751 /*******************************************************************************
752  Input Capture Driver Interface Declarations for Static Single Instance Driver
753  Company:
754  Microchip Technology Inc.
755  File Name:
756  help_drv_ic.h
757  Summary:
758  Input Capture driver interface declarations for the static single instance
759  driver.
760  Description:
761  The Input Capture device driver provides a simple interface to manage the
762  Input Capture modules on Microchip microcontrollers. This file defines
763  the interface declarations for the IC driver.
764 
765  Remarks:
766  Static interfaces incorporate the driver instance number within the names
767  of the routines, eliminating the need for an object ID or object handle.
768 
769  Static single-open interfaces also eliminate the need for the open handle.
770 *******************************************************************************/
771 //DOM-IGNORE-BEGIN
772 /*******************************************************************************
773 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
774 Microchip licenses to you the right to use, modify, copy and distribute
775 Software only when embedded on a Microchip microcontroller or digital signal
776 controller that is integrated into your product or third party product
777 (pursuant to the sublicense terms in the accompanying license agreement).
778 You should refer to the license agreement accompanying this Software for
779 additional information regarding your rights and obligations.
780 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
781 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
782 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
783 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
784 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
785 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
786 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
787 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
788 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
789 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
790 *******************************************************************************/
791 //DOM-IGNORE-END
792 #ifndef _DRV_IC_H
793 #define _DRV_IC_H
794 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
795 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
796 /*******************************************************************************
797  Driver Common Header Definitions
798  Company:
799  Microchip Technology Inc.
800  File Name:
801  drv_common.h
802  Summary:
803  This file defines the common macros and definitions used by the driver
804  definition and implementation headers.
805  Description:
806  This file defines the common macros and definitions used by the driver
807  definition and the implementation header.
808  Remarks:
809  The directory in which this file resides should be added to the compiler's
810  search path for header files.
811  *******************************************************************************/
812 //DOM-IGNORE-BEGIN
813 /*******************************************************************************
814 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
815 Microchip licenses to you the right to use, modify, copy and distribute
816 Software only when embedded on a Microchip microcontroller or digital signal
817 controller that is integrated into your product or third party product
818 (pursuant to the sublicense terms in the accompanying license agreement).
819 You should refer to the license agreement accompanying this Software for
820 additional information regarding your rights and obligations.
821 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
822 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
823 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
824 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
825 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
826 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
827 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
828 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
829 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
830 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
831  *******************************************************************************/
832 //DOM-IGNORE-END
833 #ifndef _DRV_COMMON_H
834 #define _DRV_COMMON_H
835 #include <stdint.h>
836 #include <stddef.h>
837 // *****************************************************************************
838 /* Device Driver I/O Intent
839  Summary:
840  Identifies the intended usage of the device when it is opened.
841  Description:
842  This enumeration identifies the intended usage of the device when the
843  caller opens the device. It identifies the desired behavior of the device
844  driver for the following:
845  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
846  block until the operation is finished or do they return immediately and
847  require the caller to call another routine to check the status of the
848  operation)
849  * Support reading and/or writing of data from/to the device
850  * Identify the buffering behavior (sometimes called "double buffering" of
851  the driver. Indicates if the driver should maintain its own read/write
852  buffers and copy data to/from these buffers to/from the caller's buffers.
853  * Identify the DMA behavior of the peripheral
854  Remarks:
855  The buffer allocation method is not identified by this enumeration. Buffers
856  can be allocated statically at build time, dynamically at run-time, or
857  even allocated by the caller and passed to the driver for its own usage if
858  a driver-specific routine is provided for such. This choice is left to
859  the design of the individual driver and is considered part of its
860  interface.
861  These values can be considered "flags". One selection from each of the
862  groups below can be ORed together to create the complete value passed
863  to the driver's open routine.
864 */
865 
866 typedef
867  enum
868  {
869  /* Read */
870  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
871  = 1 << 0 /* DOM-IGNORE-END*/
872  ,
873  /* Write */
874  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
875  = 1 << 1 /* DOM-IGNORE-END*/
876  ,
877  /* Read and Write*/
878  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
879  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
880  ,
881  /* The driver will block and will return when the operation is complete */
882  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
883  = 0 << 2 /* DOM-IGNORE-END*/
884  ,
885  /* The driver will return immediately */
886  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
887  = 1 << 2 /* DOM-IGNORE-END*/
888  ,
889  /* The driver will support only one client at a time */
890  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
891  = 1 << 3 /* DOM-IGNORE-END*/
892  ,
893  /* The driver will support multiple clients at a time */
894  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
895  = 0 << 3 /* DOM-IGNORE-END*/
896  } DRV_IO_INTENT ;
897 // *****************************************************************************
898 /* Driver Client Status
899  Summary:
900  Identifies the current status/state of a client's connection to a driver.
901  Description:
902  This enumeration identifies the current status/state of a client's link to
903  a driver.
904  Remarks:
905  The enumeration used as the return type for the client-level status routines
906  defined by each device driver or system module (for example,
907  DRV_USART_ClientStatus) must be based on the values in this enumeration.
908 */
909 
910 typedef
911  enum
912  {
913  /* Indicates that a driver-specific error has occurred. */
915  /* An unspecified error has occurred.*/
917  /* The driver is closed, no operations for this client are ongoing,
918  and/or the given handle is invalid. */
920  /* The driver is currently busy and cannot start additional operations. */
922  /* The module is running and ready for additional operations */
924  /* Indicates that the module is in a driver-specific ready/run state. */
927 // *****************************************************************************
928 /* Device Driver Blocking Status Macro
929  Summary:
930  Returns if the I/O intent provided is blocking
931  Description:
932  This macro returns if the I/O intent provided is blocking.
933  Remarks:
934  None.
935 */
936 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
937 // *****************************************************************************
938 /* Device Driver Non Blocking Status Macro
939  Summary:
940  Returns if the I/O intent provided is non-blocking.
941  Description:
942  This macro returns if the I/ intent provided is non-blocking.
943  Remarks:
944  None.
945 */
946 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
947 // *****************************************************************************
948 /* Device Driver Exclusive Status Macro
949  Summary:
950  Returns if the I/O intent provided is non-blocking.
951  Description:
952  This macro returns if the I/O intent provided is non-blocking.
953  Remarks:
954  None.
955 */
956 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
957 // *****************************************************************************
958 /* Device Driver IO Buffer Identifier
959  Summary:
960  Identifies to which buffer a device operation will apply.
961  Description:
962  This enumeration identifies to which buffer (read, write, both, or neither)
963  a device operation will apply. This is used for "flush" (or similar)
964  operations.
965 */
966 
967 typedef
968  enum
969  {
970  // Operation does not apply to any buffer
972  // Operation applies to read buffer
974  // Operation applies to write buffer
976  // Operation applies to both read and write buffers
979 // *****************************************************************************
980 /* Device Handle
981  Summary:
982  Handle to an opened device driver.
983  Description:
984  This handle identifies the open instance of a device driver. It must be
985  passed to all other driver routines (except the initialization, deinitialization,
986  or power routines) to identify the caller.
987  Remarks:
988  Every application or module that wants to use a driver must first call
989  the driver's open routine. This is the only routine that is absolutely
990  required for every driver.
991  If a driver is unable to allow an additional module to use it, it must then
992  return the special value DRV_HANDLE_INVALID. Callers should check the
993  handle returned for this value to ensure this value was not returned before
994  attempting to call any other driver routines using the handle.
995 */
996 
997 typedef
998 uintptr_t
1000 // *****************************************************************************
1001 /* Invalid Device Handle
1002  Summary:
1003  Invalid device handle.
1004  Description:
1005  If a driver is unable to allow an additional module to use it, it must then
1006  return the special value DRV_HANDLE_INVALID. Callers should check the
1007  handle returned for this value to ensure this value was not returned before
1008  attempting to call any other driver routines using the handle.
1009  Remarks:
1010  None.
1011 */
1012 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1013 // *****************************************************************************
1014 /* Not supported configuration
1015  Summary:
1016  Not supported configuration.
1017  Description:
1018  If the configuration option is not supported on an instance of the
1019  peripheral, use this macro to equate to that configuration. This option
1020  should be listed as a possible value in the description of that
1021  configuration option.
1022 */
1023 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1024 // *****************************************************************************
1025 /* Unsupported Attribute Abstraction
1026  Summary:
1027  Abstracts the use of the unsupported attribute defined by the compiler.
1028  Description:
1029  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1030  compilation of the drivers for all different variants.
1031  Example:
1032  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1033  This function will not generate a compiler error if the interface is not
1034  defined for the selected device.
1035  Remarks:
1036  None.
1037 */
1038 #define _PLIB_UNSUPPORTED
1039  //_DRV_COMMON_H
1040 /*******************************************************************************
1041  End of File
1042 */
1043 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1044 /* CLOSE_FILE Include File */
1045 
1046 #include "system/common/sys_module.h"
1047 // *****************************************************************************
1048 /* IC Driver Module Index Numbers
1049  Summary:
1050  IC driver index definitions.
1051  Description:
1052  These constants provide IC Driver index definitions.
1053  Remarks:
1054  These constants should be used in place of hard-coded numeric literals.
1055  These values should be passed into the DRV_IC_Initialize and
1056  DRV_IC_Open routines to identify the driver instance in use.
1057 */
1058 #define DRV_IC_INDEX_0 0
1059 #define DRV_IC_INDEX_1 1
1060 #define DRV_IC_INDEX_2 2
1061 #define DRV_IC_INDEX_3 3
1062 #define DRV_IC_INDEX_4 4
1063 #define DRV_IC_INDEX_5 5
1064 #define DRV_IC_INDEX_6 6
1065 #define DRV_IC_INDEX_7 7
1066 #define DRV_IC_INDEX_8 8
1067 #define DRV_IC_INDEX_9 9
1068 #define DRV_IC_INDEX_10 10
1069 #define DRV_IC_INDEX_11 11
1070 #define DRV_IC_INDEX_12 12
1071 #define DRV_IC_INDEX_13 13
1072 #define DRV_IC_INDEX_14 14
1073 #define DRV_IC_INDEX_15 15
1074 // *****************************************************************************
1075 // *****************************************************************************
1076 // Section: Interface Headers for the static driver
1077 // *****************************************************************************
1078 // *****************************************************************************
1079 // *****************************************************************************
1080 /* Function:
1081  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1082  const SYS_MODULE_INIT * const init);
1083  Summary:
1084  Initializes the Input Capture instance for the specified driver index.
1085  <p><b>Implementation:</b> Static</p>
1086  Description:
1087  This routine initializes the Input Capture driver instance for the specified
1088  driver instance, making it ready for clients to use it. The initialization
1089  routine is specified by the MHC parameters. The driver instance index is
1090  independent of the Input Capture module ID. For example, driver instance 0
1091  can be assigned to Input Capture 2.
1092  Precondition:
1093  None.
1094  Parameters:
1095  None.
1096  Returns:
1097  None.
1098  Remarks:
1099  This routine must be called before any other Input Capture routine is called.
1100  This routine should only be called once during system initialization.
1101 */
1102 
1103 SYS_MODULE_OBJ
1105  const SYS_MODULE_INDEX index ,
1106  const SYS_MODULE_INIT * const init ) ;
1107 // *****************************************************************************
1108 /* Function:
1109 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1110  Summary:
1111  Opens the Input Capture instance for the specified driver index.
1112  <p><b>Implementation:</b> Static</p>
1113  Description:
1114  This routine starts the Input Capture driver for the specified driver
1115  index, starting an input capture.
1116  Precondition:
1117  DRV_IC_Initialize has been called.
1118  Parameters:
1119  None.
1120  Returns:
1121  None.
1122  Remarks:
1123  None.
1124 */
1125 
1126 DRV_HANDLE
1127  DRV_IC_Open (
1128  const SYS_MODULE_INDEX drvIndex ,
1129  const DRV_IO_INTENT intent ) ;
1130 // *****************************************************************************
1131 /* Function:
1132  void DRV_IC_Close(DRV_HANDLE handle)
1133  Summary:
1134  Closes the Input Capture instance for the specified driver index.
1135  <p><b>Implementation:</b> Static</p>
1136  Description:
1137  This routine stops the Input Capture driver for the specified driver
1138  index, stopping an input capture.
1139  Precondition:
1140  DRV_IC_Initialize has been called.
1141  Parameters:
1142  None.
1143  Returns:
1144  None.
1145  Remarks:
1146  None.
1147 */
1148 
1149 void
1150  DRV_IC_Close (
1151  DRV_HANDLE handle ) ;
1152 // *****************************************************************************
1153 /* Function:
1154 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1155  Summary:
1156  Starts the Input Capture instance for the specified driver index.
1157  <p><b>Implementation:</b> Static</p>
1158  Description:
1159  This routine starts the Input Capture driver for the specified driver
1160  index, starting an input capture.
1161  Precondition:
1162  DRV_IC_Initialize has been called.
1163  Parameters:
1164  None.
1165  Returns:
1166  None.
1167  Remarks:
1168  None.
1169 */
1170 
1171 DRV_HANDLE
1172  DRV_IC_Start (
1173  const SYS_MODULE_INDEX drvIndex ,
1174  const DRV_IO_INTENT intent ) ;
1175 // *****************************************************************************
1176 /* Function:
1177  void DRV_IC_Stop(DRV_HANDLE handle)
1178  Summary:
1179  Stops the Input Capture instance for the specified driver index.
1180  <p><b>Implementation:</b> Static</p>
1181  Description:
1182  This routine stops the Input Capture driver for the specified driver
1183  index, stopping an input capture.
1184  Precondition:
1185  DRV_IC_Initialize has been called.
1186  Parameters:
1187  None.
1188  Returns:
1189  None.
1190  Remarks:
1191  None.
1192 */
1193 
1194 void
1195  DRV_IC_Stop (
1196  DRV_HANDLE handle ) ;
1197 // *****************************************************************************
1198 /* Function:
1199  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1200  Summary:
1201  Reads the 32-bit Input Capture for the specified driver index.
1202  <p><b>Implementation:</b> Static</p>
1203  Description:
1204  This routine reads the 32-bit data for the specified driver index
1205  Precondition:
1206  DRV_IC_Initialize has been called.
1207  Parameters:
1208  None.
1209  Returns:
1210  uint32_t value of the data read from the Input Capture.
1211  Remarks:
1212  None.
1213 */
1214 
1215 uint32_t
1217  DRV_HANDLE handle ) ;
1218 // *****************************************************************************
1219 /* Function:
1220  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1221  Summary:
1222  Reads the 16-bit Input Capture for the specified driver index.
1223  <p><b>Implementation:</b> Static</p>
1224  Description:
1225  This routine reads the 16-bit data for the specified driver index.
1226  Precondition:
1227  DRV_IC_Initialize has been called.
1228  Parameters:
1229  None.
1230  Returns:
1231  uint16_t value of the data read from the Input Capture.
1232  Remarks:
1233  None.
1234 */
1235 
1236 uint16_t
1238  DRV_HANDLE handle ) ;
1239 // *****************************************************************************
1240 /* Function:
1241  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1242  Summary:
1243  Returns the Input Capture instance buffer empty status for the specified driver
1244  index.
1245  <p><b>Implementation:</b> Static</p>
1246  Description:
1247  Returns the Input Capture instance buffer empty status for the specified driver
1248  index. The function should be called to determine whether or not the IC buffer
1249  has data.
1250  Precondition:
1251  DRV_IC_Initialize has been called.
1252  Parameters:
1253  None.
1254  Returns:
1255  Boolean
1256  - 1 - Buffer is empty
1257  - 0 - Buffer is not empty
1258  Remarks:
1259  None.
1260 */
1261 
1262 bool
1264  DRV_HANDLE handle ) ;
1265 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1266 /*******************************************************************************
1267  IC Driver Interface Declarations for Static Single Instance Driver
1268  Company:
1269  Microchip Technology Inc.
1270  File Name:
1271  drv_ic_static.h
1272  Summary:
1273  IC driver interface declarations for the static single instance driver.
1274  Description:
1275  The IC device driver provides a simple interface to manage the IC
1276  modules on Microchip microcontrollers. This file defines the interface
1277  Declarations for the IC driver.
1278 
1279  Remarks:
1280  Static interfaces incorporate the driver instance number within the names
1281  of the routines, eliminating the need for an object ID or object handle.
1282 
1283  Static single-open interfaces also eliminate the need for the open handle.
1284 *******************************************************************************/
1285 //DOM-IGNORE-BEGIN
1286 /*******************************************************************************
1287 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1288 Microchip licenses to you the right to use, modify, copy and distribute
1289 Software only when embedded on a Microchip microcontroller or digital signal
1290 controller that is integrated into your product or third party product
1291 (pursuant to the sublicense terms in the accompanying license agreement).
1292 You should refer to the license agreement accompanying this Software for
1293 additional information regarding your rights and obligations.
1294 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1295 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1296 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1297 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1298 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1299 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1300 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1301 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1302 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1303 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1304 *******************************************************************************/
1305 //DOM-IGNORE-END
1306 #ifndef _DRV_IC_STATIC_H
1307 #define _DRV_IC_STATIC_H
1308 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1309 #define DRV_IC_Close( handle )
1310 // *****************************************************************************
1311 // *****************************************************************************
1312 // Section: Interface Headers for Instance 0 for the static driver
1313 // *****************************************************************************
1314 // *****************************************************************************
1315 
1316 void
1317  DRV_IC0_Initialize ( void ) ;
1318 
1319 void
1320  DRV_IC0_Start ( void ) ;
1321 
1322 void
1323  DRV_IC0_Stop ( void ) ;
1324 
1325 uint32_t
1326  DRV_IC0_Capture32BitDataRead ( void ) ;
1327 
1328 uint16_t
1329  DRV_IC0_Capture16BitDataRead ( void ) ;
1330 
1331 bool
1332  DRV_IC0_BufferIsEmpty ( void ) ;
1333  // #ifndef _DRV_IC_STATIC_H
1334 /*******************************************************************************
1335  End of File
1336 */
1337 
1338 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1339 /* CLOSE_FILE Include File */
1340 
1341  // #ifndef _DRV_IC_H
1342 /*******************************************************************************
1343  End of File
1344 */
1345 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1346 /* CLOSE_FILE Include File */
1347 
1348 #include "system/devcon/sys_devcon.h"
1349 #include "system/clk/sys_clk.h"
1350 #include "system/int/sys_int.h"
1351 #include "system/tmr/sys_tmr.h"
1352 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1353 /*******************************************************************************
1354  ADC Driver Interface Declarations for Static Single Instance Driver
1355  Company:
1356  Microchip Technology Inc.
1357  File Name:
1358  drv_adc_static.h
1359  Summary:
1360  ADC driver interface declarations for the static single instance driver.
1361  Description:
1362  The ADC device driver provides a simple interface to manage the ADC
1363  modules on Microchip microcontrollers. This file defines the interface
1364  Declarations for the ADC driver.
1365 
1366  Remarks:
1367  Static interfaces incorporate the driver instance number within the names
1368  of the routines, eliminating the need for an object ID or object handle.
1369 
1370  Static single-open interfaces also eliminate the need for the open handle.
1371 *******************************************************************************/
1372 //DOM-IGNORE-BEGIN
1373 /*******************************************************************************
1374 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1375 Microchip licenses to you the right to use, modify, copy and distribute
1376 Software only when embedded on a Microchip microcontroller or digital signal
1377 controller that is integrated into your product or third party product
1378 (pursuant to the sublicense terms in the accompanying license agreement).
1379 You should refer to the license agreement accompanying this Software for
1380 additional information regarding your rights and obligations.
1381 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1382 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1383 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1384 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1385 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1386 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1387 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1388 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1389 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1390 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1391 *******************************************************************************/
1392 //DOM-IGNORE-END
1393 #ifndef _DRV_ADC_STATIC_H
1394 #define _DRV_ADC_STATIC_H
1395 #include <stdbool.h>
1396 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1397 #include "peripheral/adchs/plib_adchs.h"
1398 #include "peripheral/int/plib_int.h"
1399 
1400 typedef
1401  enum
1402  {
1403  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1405  } DRV_ADC_MODULE_ID ;
1406 // *****************************************************************************
1407 // *****************************************************************************
1408 // Section: Interface Headers for ADC Static Driver
1409 // *****************************************************************************
1410 // *****************************************************************************
1411 
1412 void
1413  DRV_ADC_Initialize ( void ) ;
1414 
1415 inline void
1416  DRV_ADC_DeInitialize ( void ) ;
1417 
1418 inline void
1419  DRV_ADC0_Open ( void ) ;
1420 
1421 inline void
1422  DRV_ADC0_Close ( void ) ;
1423 
1424 inline void
1425  DRV_ADC1_Open ( void ) ;
1426 
1427 inline void
1428  DRV_ADC1_Close ( void ) ;
1429 
1430 inline void
1431  DRV_ADC_Start ( void ) ;
1432 
1433 inline void
1434  DRV_ADC_Stop ( void ) ;
1435 
1436 uint32_t
1438  uint8_t bufIndex ) ;
1439 
1440 bool
1442  uint8_t bufIndex ) ;
1443  // #ifndef _DRV_ADC_STATIC_H
1444 /*******************************************************************************
1445  End of File
1446 */
1447 
1448 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1449 /* CLOSE_FILE Include File */
1450 
1451 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1452 /*******************************************************************************
1453  Timer Driver Interface Declarations for Static Single Instance Driver
1454  Company:
1455  Microchip Technology Inc.
1456  File Name:
1457  drv_tmr_static.h
1458  Summary:
1459  Timer driver interface declarations for the static single instance driver.
1460  Description:
1461  The Timer device driver provides a simple interface to manage the Timer
1462  modules on Microchip microcontrollers. This file defines the interface
1463  Declarations for the TMR driver.
1464 
1465  Remarks:
1466  Static interfaces incorporate the driver instance number within the names
1467  of the routines, eliminating the need for an object ID or object handle.
1468 
1469  Static single-open interfaces also eliminate the need for the open handle.
1470 *******************************************************************************/
1471 //DOM-IGNORE-BEGIN
1472 /*******************************************************************************
1473 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1474 Microchip licenses to you the right to use, modify, copy and distribute
1475 Software only when embedded on a Microchip microcontroller or digital signal
1476 controller that is integrated into your product or third party product
1477 (pursuant to the sublicense terms in the accompanying license agreement).
1478 You should refer to the license agreement accompanying this Software for
1479 additional information regarding your rights and obligations.
1480 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1481 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1482 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1483 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1484 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1485 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1486 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1487 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1488 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1489 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1490 *******************************************************************************/
1491 //DOM-IGNORE-END
1492 #ifndef _DRV_TMR_STATIC_H
1493 #define _DRV_TMR_STATIC_H
1494 // *****************************************************************************
1495 // *****************************************************************************
1496 // Section: Include Headers
1497 // *****************************************************************************
1498 // *****************************************************************************
1499 #include <stdint.h>
1500 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1501 /*******************************************************************************
1502  Timer Device Driver Interface Definition
1503  Company:
1504  Microchip Technology Inc.
1505  File Name:
1506  drv_tmr.h
1507  Summary:
1508  Timer device driver interface header file.
1509  Description:
1510  This header file contains the function prototypes and definitions of the
1511  data types and constants that make up the interface to the Timer device
1512  driver.
1513 *******************************************************************************/
1514 //DOM-IGNORE-BEGIN
1515 /*******************************************************************************
1516 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1517 Microchip licenses to you the right to use, modify, copy and distribute
1518 Software only when embedded on a Microchip microcontroller or digital signal
1519 controller that is integrated into your product or third party product
1520 (pursuant to the sublicense terms in the accompanying license agreement).
1521 You should refer to the license agreement accompanying this Software for
1522 additional information regarding your rights and obligations.
1523 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1524 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1525 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1526 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1527 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1528 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1529 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1530 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1531 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1532 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1533 *******************************************************************************/
1534 //DOM-IGNORE-END
1535 #ifndef _DRV_TMR_H
1536 #define _DRV_TMR_H
1537 // *****************************************************************************
1538 // *****************************************************************************
1539 // Section: File includes
1540 // *****************************************************************************
1541 // *****************************************************************************
1542 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1543 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
1544 #include "peripheral/tmr/plib_tmr.h"
1545 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
1546 /*******************************************************************************
1547  Timer Device Driver Interface Definition
1548  Company:
1549  Microchip Technology Inc.
1550  File Name:
1551  tmr_definitions_pic32m.h
1552  Summary:
1553  Timer device driver definitions header file.
1554  Description:
1555  This header file contains the definitions of the
1556  data types and constants that make up the interface to the Timer device
1557  driver.
1558 *******************************************************************************/
1559 //DOM-IGNORE-BEGIN
1560 /*******************************************************************************
1561 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1562 Microchip licenses to you the right to use, modify, copy and distribute
1563 Software only when embedded on a Microchip microcontroller or digital signal
1564 controller that is integrated into your product or third party product
1565 (pursuant to the sublicense terms in the accompanying license agreement).
1566 You should refer to the license agreement accompanying this Software for
1567 additional information regarding your rights and obligations.
1568 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1569 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1570 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1571 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1572 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1573 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1574 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1575 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1576 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1577 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1578 *******************************************************************************/
1579 //DOM-IGNORE-END
1580 #ifndef _TMR_DEFINITIONS_PIC32M_H
1581 #define _TMR_DEFINITIONS_PIC32M_H
1582 // DOM-IGNORE-BEGIN
1583 // DOM-IGNORE-END
1584 
1585 typedef
1586  enum
1587  {
1588  /* Clock input to the timer module is internal(Peripheral Clock) */
1590  /*DOM-IGNORE-BEGIN*/
1591  = 0x00 /*DOM-IGNORE-END*/
1592  ,
1593  /* Clock input to the timer module is from T1CK pin (external)
1594  with clock synchronization enabled */
1596  /*DOM-IGNORE-BEGIN*/
1597  = 0x01 /*DOM-IGNORE-END*/
1598  ,
1599  /* Clock input to the timer module is from T1CK pin (external)
1600  with clock synchronization disabled */
1602  /*DOM-IGNORE-BEGIN*/
1603  = 0x11 /*DOM-IGNORE-END*/
1604  ,
1605  /* Clock input to the timer module is from secondary oscillator (external)
1606  with clock synchronization enabled */
1608  /*DOM-IGNORE-BEGIN*/
1609  = 0x02 /*DOM-IGNORE-END*/
1610  ,
1611  /* Clock input to the timer module is from secondary oscillator (external)
1612  with clock synchronization disabled */
1614  /*DOM-IGNORE-BEGIN*/
1615  = 0x12 /*DOM-IGNORE-END*/
1616  ,
1617  /* Clock input to the timer module is from LPRC
1618  with clock synchronization enabled */
1620  /*DOM-IGNORE-BEGIN*/
1621  = 0x03 /*DOM-IGNORE-END*/
1622  ,
1623  /* Clock input to the timer module is from LPRC
1624  with clock synchronization disabled */
1626  /*DOM-IGNORE-BEGIN*/
1627  = 0x13 /*DOM-IGNORE-END*/
1629 //DOM-IGNORE-BEGIN
1630 //DOM-IGNORE-END
1631  // #ifndef _DRV_TMR_H
1632 /*******************************************************************************
1633  End of File
1634 */
1635 
1636 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
1637 /* CLOSE_FILE Include File */
1638 
1639 #include "system/int/sys_int.h" // System Interrupt Definitions
1640 #include "system/clk/sys_clk.h"
1641 // DOM-IGNORE-BEGIN
1642 // DOM-IGNORE-END
1643 // *****************************************************************************
1644 // *****************************************************************************
1645 // Section: TMR Driver Data Types
1646 // *****************************************************************************
1647 // *****************************************************************************
1648 // *****************************************************************************
1649 /* Timer Driver Module Index Numbers
1650  Summary:
1651  Timer driver index definitions
1652  Description:
1653  These constants provide Timer driver index definitions.
1654  Remarks:
1655  These constants should be used in place of hard-coded numeric literals.
1656  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
1657  functions to identify the driver instance in use.
1658 */
1659 #define DRV_TMR_INDEX_0 0
1660 #define DRV_TMR_INDEX_1 1
1661 #define DRV_TMR_INDEX_2 2
1662 #define DRV_TMR_INDEX_3 3
1663 #define DRV_TMR_INDEX_4 4
1664 #define DRV_TMR_INDEX_5 5
1665 #define DRV_TMR_INDEX_6 6
1666 #define DRV_TMR_INDEX_7 7
1667 #define DRV_TMR_INDEX_8 8
1668 #define DRV_TMR_INDEX_9 9
1669 #define DRV_TMR_INDEX_10 10
1670 #define DRV_TMR_INDEX_11 11
1671 // *****************************************************************************
1672 /* Timer Driver Module Index Count
1673  Summary:
1674  Number of valid Timer driver indices.
1675  Description:
1676  This constant identifies Timer driver index definitions.
1677  Remarks:
1678  This constant should be used in place of hard-coded numeric literals.
1679  This value is device-specific.
1680 */
1681 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
1682 // *****************************************************************************
1683 /* Timer Driver Client Status
1684  Summary:
1685  Identifies the client-specific status of the Timer driver
1686  Description:
1687  This enumeration identifies the client-specific status of the Timer driver.
1688  Remarks:
1689  None.
1690 */
1691 
1692 typedef
1693  enum
1694  {
1695  /* Driver is invalid (or unopened) state */
1697  /*DOM-IGNORE-BEGIN*/
1698  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
1699  ,
1700  /* An operation is currently in progress */
1702  /*DOM-IGNORE-BEGIN*/
1703  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
1704  ,
1705  /* Ready, no operations running */
1707  /*DOM-IGNORE-BEGIN*/
1708  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
1709  ,
1710  /* Timer started and running, processing transactions */
1712  /*DOM-IGNORE-BEGIN*/
1713  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
1715 // *****************************************************************************
1716 /* Timer Driver Clock sources
1717  Summary:
1718  Lists the clock sources available for timer driver.
1719  Description:
1720  This enumeration lists all the available clock sources for the timer
1721  hardware.
1722  Remarks:
1723  Not all modes are available on all devices.
1724  'Synchronization' may not be applicable for all the instances of the timer.
1725  The driver discards the Synchronization mode selected if it is not
1726  applicable for the selected hardware.
1727 */
1728 // *****************************************************************************
1729 /* Timer Driver Operation mode
1730  Summary:
1731  Lists the operation modes available for timer driver.
1732  Description:
1733  This enumeration lists all the available operation modes that are valid for
1734  the timer hardware.
1735  Remarks:
1736  Not all modes are available on all devices.
1737 */
1738 
1739 typedef
1740  enum
1741  {
1742  /* The timer module operating mode none/invalid */
1744  /* The timer module operates in 16 bit mode */
1746  /* The timer module operates in 32 bit mode */
1747  /* This will combine two 16 bit timer modules */
1750 // *****************************************************************************
1751 /* Timer Driver divider operating specification
1752  Summary:
1753  This data structure specifies the divider values that can be obtained by the
1754  timer module.
1755  Description:
1756  This data structure specifies the divider values that can be obtained by the
1757  timer hardware.
1758  Remarks:
1759  None.
1760 */
1761 
1762 typedef
1763  struct
1764  {
1765  /* The minimum divider value that the timer module can obtain */
1766  uint32_t dividerMin ;
1767  /* The maximum divider value that the timer module can obtain */
1768  uint32_t dividerMax ;
1769  /* The divider step value, between 2 divider values */
1770  /* Should be 1 for most timers */
1771  uint32_t dividerStep ;
1773 // *****************************************************************************
1774 /* Timer Driver Initialize Data
1775  Summary:
1776  Defines the Timer driver initialization data.
1777  Description:
1778  This data type defines data required to initialize the Timer driver.
1779  Remarks:
1780  Not all initialization features are available on all devices.
1781 */
1782 
1783 typedef
1784  struct
1785  {
1786  /* System module initialization. */
1787  SYS_MODULE_INIT moduleInit ;
1788  /* Identifies timer hardware module (PLIB-level) ID */
1789  TMR_MODULE_ID tmrId ;
1790  /* Clock Source select. */
1791  DRV_TMR_CLK_SOURCES clockSource ;
1792  /* Prescaler Selection from the processor enumeration */
1793  TMR_PRESCALE prescale ;
1794  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
1795  is selected the interrupt will be generated by the 2nd timer of the pair,
1796  the odd numbered one. */
1797  INT_SOURCE interruptSource ;
1798  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
1799  timer modules to form a 32 bit one. This is usually only necessary for
1800  very long delays. */
1801  DRV_TMR_OPERATION_MODE mode ;
1802  /* Asynchronous write enable configuration. If true the asynchronous write
1803  is enabled. For timers that do not support this feature the value is
1804  ignored */
1805  bool asyncWriteEnable ;
1806  } DRV_TMR_INIT ;
1807 // *****************************************************************************
1808 /* Timer Driver Callback Function Pointer
1809  Summary:
1810  Pointer to a Timer driver callback function data type.
1811  Description:
1812  This data type defines a pointer to a Timer driver callback function.
1813  Remarks:
1814  Useful only when timer alarm callback support is enabled by defining the
1815  DRV_TMR_ALARM_ENABLE configuration option.
1816 */
1817 
1818 typedef
1819 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
1820 uint32_t alarmCount ) ;
1821 // *****************************************************************************
1822 // *****************************************************************************
1823 // Section: Timer Driver Module Interface Functions
1824 // *****************************************************************************
1825 // *****************************************************************************
1826 // *****************************************************************************
1827 /* Function:
1828  SYS_MODULE_OBJ DRV_TMR_Initialize
1829  (
1830  const SYS_MODULE_INDEX drvIndex,
1831  const SYS_MODULE_INIT * const init
1832  )
1833  Summary:
1834  Initializes the Timer driver.
1835  <p><b>Implementation:</b> Static/Dynamic</p>
1836  Description:
1837  This function initializes the Timer driver, making it ready for clients to
1838  open and use it.
1839  Precondition:
1840  None.
1841  Parameters:
1842  drvIndex - Index for the driver instance to be initialized
1843  init - Pointer to a data structure containing any data necessary
1844  to initialize the driver.
1845  Returns:
1846  If successful, returns a valid handle to a driver object. Otherwise, it
1847  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
1848  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
1849  Example:
1850  <code>
1851  DRV_TMR_INIT init;
1852  SYS_MODULE_OBJ objectHandle;
1853  // Populate the timer initialization structure
1854  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
1855  init.tmrId = TMR_ID_2;
1856  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
1857  init.prescale = TMR_PRESCALE_VALUE_256;
1858  init.interruptSource = INT_SOURCE_TIMER_2;
1859  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
1860  init.asyncWriteEnable = false;
1861  // Do something
1862  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
1863  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
1864  {
1865  // Handle error
1866  }
1867  </code>
1868  Remarks:
1869  This function must be called before any other Timer driver function is
1870  called.
1871  This function should only be called once during system initialization unless
1872  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
1873  This function will NEVER block for hardware access. The system must use
1874  DRV_TMR_Status to find out when the driver is in the ready state.
1875  Build configuration options may be used to statically override options in
1876  the "init" structure and will take precedence over initialization data
1877  passed using this function.
1878 */
1879 
1880 SYS_MODULE_OBJ
1882  const SYS_MODULE_INDEX drvIndex ,
1883  const SYS_MODULE_INIT * const init ) ;
1884 // *****************************************************************************
1885 /* Function:
1886  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
1887  Summary:
1888  Deinitializes the specified instance of the Timer driver.
1889  <p><b>Implementation:</b> Dynamic</p>
1890  Description:
1891  Deinitializes the specified instance of the Timer driver, disabling
1892  its operation (and any hardware). All internal data is invalidated.
1893  Precondition:
1894  The DRV_TMR_Initialize function must have been called before calling this
1895  function and a valid SYS_MODULE_OBJ must have been returned.
1896  Parameters:
1897  object - Driver object handle, returned from DRV_TMR_Initialize
1898  Returns:
1899  None.
1900  Example:
1901  <code>
1902  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
1903  SYS_STATUS tmrStatus;
1904  DRV_TMR_Deinitialize ( tmrObject );
1905  tmrStatus = DRV_TMR_Status ( tmrObject );
1906  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
1907  {
1908  // Check again later if you need to know
1909  // when the driver is deinitialized.
1910  }
1911  </code>
1912  Remarks:
1913  Once the Initialize operation has been called, the Deinitialize operation
1914  must be called before the Initialize operation can be called again.
1915  This function will NEVER block waiting for hardware. If the operation
1916  requires time to allow the hardware to complete, this will be reported by
1917  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
1918  out when the module is in the ready state.
1919 */
1920 
1921 void
1923  SYS_MODULE_OBJ object ) ;
1924 // *****************************************************************************
1925 /* Function:
1926  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
1927  Summary:
1928  Provides the current status of the Timer driver.
1929  <p><b>Implementation:</b> Dynamic</p>
1930  Description:
1931  This function provides the current status of the Timer driver.
1932  Precondition:
1933  The DRV_TMR_Initialize function must have been called before calling this
1934  function.
1935  Parameters:
1936  object - Driver object handle, returned from DRV_TMR_Initialize
1937  Returns:
1938  SYS_STATUS_READY - Indicates that the driver is initialized and ready
1939  for operation
1940  Note: Any value greater than SYS_STATUS_READY is
1941  also a normal running state in which the driver
1942  is ready to accept new operations.
1943  SYS_STATUS_ERROR - Indicates that the driver is in an error state
1944  Note: Any value less than SYS_STATUS_ERROR is
1945  also an error state.
1946  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
1947  Note: This value is less than SYS_STATUS_ERROR.
1948  Example:
1949  <code>
1950  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
1951  SYS_STATUS tmrStatus;
1952  tmrStatus = DRV_TMR_Status ( object );
1953  else if ( SYS_STATUS_ERROR >= tmrStatus )
1954  {
1955  // Handle error
1956  }
1957  </code>
1958  Remarks:
1959  The this operation can be used to determine when any of the driver's module
1960  level operations has completed.
1961  Once the status operation returns SYS_STATUS_READY, the driver is ready for
1962  operation.
1963  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
1964  also an error state.
1965  This function will NEVER block waiting for hardware.
1966 */
1967 
1968 SYS_STATUS
1969  DRV_TMR_Status (
1970  SYS_MODULE_OBJ object ) ;
1971 // *****************************************************************************
1972 /* Function:
1973  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
1974  Summary:
1975  Maintains the driver's state machine.
1976  <p><b>Implementation:</b> Dynamic</p>
1977  Description:
1978  This function is used to maintain the driver's internal state machine and
1979  processes the timer events..
1980  Precondition:
1981  The DRV_TMR_Initialize function must have been called for the specified Timer
1982  driver instance.
1983  Parameters:
1984  object - Object handle for the specified driver instance (returned from
1985  DRV_TMR_Initialize)
1986  Returns:
1987  None
1988  Example:
1989  <code>
1990  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
1991  while (true)
1992  {
1993  DRV_TMR_Tasks ( object );
1994  // Do other tasks
1995  }
1996  </code>
1997  Remarks:
1998  This function is normally not called directly by an application. It is
1999  called by the system's Tasks routine (SYS_Tasks)
2000 */
2001 
2002 void
2003  DRV_TMR_Tasks (
2004  SYS_MODULE_OBJ object ) ;
2005 // *****************************************************************************
2006 // *****************************************************************************
2007 // Section: TMR Driver Client Functions
2008 // *****************************************************************************
2009 // *****************************************************************************
2010 // *****************************************************************************
2011 /* Function:
2012  DRV_HANDLE DRV_TMR_Open
2013  (
2014  const SYS_MODULE_INDEX index,
2015  const DRV_IO_INTENT intent
2016  )
2017  Summary:
2018  Opens the specified Timer driver instance and returns a handle to it.
2019  <p><b>Implementation:</b> Dynamic</p>
2020  Description:
2021  This function opens the specified Timer driver instance and provides a
2022  handle that must be provided to all other client-level operations to
2023  identify the caller and the instance of the driver. Timer driver does not
2024  support multiple clients. If two tasks want to use the timer, one should
2025  wait until the other one gets closed.
2026  Precondition:
2027  The DRV_TMR_Initialize function must have been called before calling this
2028  function.
2029  Parameters:
2030  index - Identifier for the object instance to be opened
2031  intent - Zero or more of the values from the enumeration
2032  DRV_IO_INTENT ORed together to indicate the intended use
2033  of the driver
2034  Returns:
2035  If successful, the function returns a valid open instance handle (a number
2036  identifying both the caller and the module instance).
2037  If an error occurs, the return value is DRV_HANDLE_INVALID.
2038  Example:
2039  <code>
2040  DRV_HANDLE handle;
2041  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2042  if ( DRV_HANDLE_INVALID == handle )
2043  {
2044  // Unable to open the driver
2045  }
2046  </code>
2047  Remarks:
2048  The handle returned is valid until the DRV_TMR_Close function is called.
2049  This function will NEVER block waiting for hardware.
2050  If the requested intent flags are not supported, the function will return
2051  DRV_HANDLE_INVALID.
2052  The Timer driver does not support DRV_IO_INTENT_SHARED.
2053  Only exclusive access is supported for now.
2054 */
2055 
2056 DRV_HANDLE
2057  DRV_TMR_Open (
2058  const SYS_MODULE_INDEX index ,
2059  const DRV_IO_INTENT intent ) ;
2060 // *****************************************************************************
2061 /* Function:
2062  void DRV_TMR_Close ( DRV_HANDLE handle )
2063  Summary:
2064  Closes an opened instance of the Timer driver.
2065  <p><b>Implementation:</b> Dynamic</p>
2066  Description:
2067  This function closes an opened instance of the Timer driver, invalidating
2068  the handle.
2069  Precondition:
2070  The DRV_TMR_Initialize function must have been called for the specified
2071  Timer driver instance.
2072  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2073  Parameters:
2074  handle - A valid open-instance handle, returned from the driver's
2075  open routine
2076  Returns:
2077  None
2078  Example:
2079  <code>
2080  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2081  DRV_TMR_Close ( handle );
2082  </code>
2083  Remarks:
2084  After calling this function, the handle passed in "handle" must not be used
2085  with any of the remaining driver functions. A new handle must be obtained
2086  by calling DRV_TMR_Open before the caller may use the driver again.
2087  Note: Usually there is no need for the driver client to verify that the Close
2088  operation has completed.
2089 */
2090 
2091 void
2092  DRV_TMR_Close (
2093  DRV_HANDLE handle ) ;
2094 // *****************************************************************************
2095 /* Function:
2096  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2097  Summary:
2098  Gets the status of the client operation.
2099  <p><b>Implementation:</b> Dynamic</p>
2100  Description:
2101  This function gets the status of the recently completed client level
2102  operation.
2103  Precondition:
2104  The DRV_TMR_Initialize function must have been called for the specified
2105  Timer driver instance.
2106  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2107  Parameters:
2108  handle - A valid open-instance handle, returned from the driver's
2109  open routine
2110  Returns:
2111  None
2112  Example:
2113  <code>
2114  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2115  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2116  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2117  </code>
2118  Remarks:
2119  None.
2120 */
2121 
2124  DRV_HANDLE handle ) ;
2125 // *****************************************************************************
2126 // *****************************************************************************
2127 // Section: TMR Driver Counting functions
2128 // *****************************************************************************
2129 // *****************************************************************************
2130 // *****************************************************************************
2131 /* Function:
2132  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2133  Summary:
2134  Updates the Timer's counter register.
2135  <p><b>Implementation:</b> Static/Dynamic</p>
2136  Description:
2137  This function updates the Timer's value in the counter register.
2138  Precondition:
2139  The DRV_TMR_Initialize function must have been called.
2140  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2141  Parameters:
2142  handle - A valid open-instance handle, returned from the driver's
2143  open routine
2144  counterPeriod - counter period value
2145  - a 16 bit value if the timer is configured in 16 bit mode
2146  - a 32 bit value if the timer is configured in 32 bit mode
2147  Returns:
2148  None.
2149  Example:
2150  <code>
2151  </code>
2152  Remarks:
2153  None.
2154 */
2155 
2156 void
2158  DRV_HANDLE handle ,
2159  uint32_t counterPeriod ) ;
2160 // *****************************************************************************
2161 /* Function:
2162  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2163  Summary:
2164  Reads the Timer's counter register.
2165  <p><b>Implementation:</b> Static/Dynamic</p>
2166  Description:
2167  This function returns the Timer's value in the counter register.
2168  Precondition:
2169  The DRV_TMR_Initialize function must have been called.
2170  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2171  Parameters:
2172  handle - A valid open-instance handle, returned from the driver's
2173  open routine
2174  Returns:
2175  Timer current period:
2176  - a 16 bit value if the timer is configured in 16 bit mode
2177  - a 32 bit value if the timer is configured in 32 bit mode
2178  Example:
2179  <code>
2180  //Example to use timer for precision time measurement
2181  //without configuring an alarm (interrupt based)
2182  char appState = 0;
2183  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2184  switch ( appState )
2185  {
2186  case 0:
2187  //Calculate and set the counter period
2188  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2189  //counter starts
2190  DRV_TMR_Start ( tmrHandle );
2191  //Trigger an application operation
2192  app_trigger_operation();
2193  //Check for time-out in the next state
2194  appState++;
2195  case 1:
2196  //Overflows and stops at 0 if no alarm is set
2197  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2198  {
2199  //Time-out
2200  return false;
2201  }
2202  else if ( app_operation_isComplete( ) )
2203  {
2204  //Operation is complete before time-out
2205  return true;
2206  }
2207  </code>
2208  Remarks:
2209  None.
2210 */
2211 
2212 uint32_t
2214  DRV_HANDLE handle ) ;
2215 // *****************************************************************************
2216 /* Function:
2217  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2218  Summary:
2219  Clears the Timer's counter register.
2220  <p><b>Implementation:</b> Static/Dynamic</p>
2221  Description:
2222  This function clears the Timer's value in the counter register.
2223  Precondition:
2224  The DRV_TMR_Initialize function must have been called.
2225  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2226  Parameters:
2227  handle - A valid open-instance handle, returned from the driver's
2228  open routine
2229  Returns:
2230  None.
2231  Example:
2232  <code>
2233  </code>
2234  Remarks:
2235  None.
2236 */
2237 
2238 void
2240  DRV_HANDLE handle ) ;
2241 // *****************************************************************************
2242 /* Function:
2243  bool DRV_TMR_AlarmRegister
2244  (
2245  DRV_HANDLE handle,
2246  uint32_t divider,
2247  bool isPeriodic,
2248  uintptr_t context,
2249  DRV_TMR_CALLBACK callBack
2250  )
2251  Summary:
2252  Sets up an alarm.
2253  <p><b>Implementation:</b> Dynamic</p>
2254  Description:
2255  This function sets up an alarm, allowing the client to receive a callback
2256  from the driver when the timer counter reaches zero. Alarms can be one-shot
2257  or periodic. A periodic alarm will reload the timer and generate alarm
2258  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2259  divider;
2260  Precondition:
2261  The DRV_TMR_Initialize function must have been called.
2262  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2263  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2264  Parameters:
2265  handle - A valid handle, returned from DRV_TMR_Open
2266  divider - The value to divide the timer clock source to obtain the
2267  required alarm frequency.
2268  - a 16 bit value if the timer is configured in 16 bit mode
2269  - a 32 bit value if the timer is configured in 32 bit mode
2270  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2271  context - A reference, call back function will be called with the same
2272  reference.
2273  callBack - A call back function which will be called on time out.
2274  Returns:
2275  - true - if the call succeeded
2276  - false - the obtained divider could not be obtained or the passed handle was invalid
2277  Example:
2278  <code>
2279  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2280  void setupTask ()
2281  {
2282  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2283  uint32_t myFreq = 1000; // 1KHz
2284  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2285  // calculate the divider needed
2286  uint32_t divider = clkFreq / myFreq;
2287  // Start the alarm
2288  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2289  {
2290  // divider value could not be obtain;
2291  // handle the error
2292  //
2293  }
2294  }
2295  </code>
2296  Remarks:
2297  The divider value will be truncated to a 16 bit value if the timer is
2298  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2299  callback.
2300 */
2301 
2302 bool
2304  DRV_HANDLE handle ,
2305  uint32_t divider ,
2306  bool isPeriodic ,
2307  uintptr_t context ,
2308  DRV_TMR_CALLBACK callBack ) ;
2309 // *****************************************************************************
2310 /* Function:
2311  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2312  Summary:
2313  Disables an alarm signal.
2314  <p><b>Implementation:</b> Dynamic</p>
2315  Description:
2316  This function allows the client to disable an alarm generation.
2317  Use DRV_TMR_AlarmEnable to re-enable.
2318  Precondition:
2319  The DRV_TMR_Initialize function must have been called.
2320  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2321  A client alarm must be active.
2322  Parameters:
2323  handle - A valid handle, returned from DRV_TMR_Open
2324  Returns:
2325  The current status of the alarm:
2326  - true if the alarm was currently enabled
2327  - false if the alarm was currently disabled
2328  Example:
2329  <code>
2330  </code>
2331  Remarks:
2332  When the driver operates in interrupts this call resolves to a device
2333  interrupt disable.
2334  Do NOT disable the timer except for very short periods of time. If the time
2335  that the interrupt is disabled is longer than a wrap around period and the
2336  interrupt is missed, the hardware has no means of recovering and the
2337  resulting timing will be inaccurate.
2338 */
2339 
2340 bool
2342  DRV_HANDLE handle ) ;
2343 // *****************************************************************************
2344 /* Function:
2345  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2346  Summary:
2347  Re-enables an alarm signal.
2348  <p><b>Implementation:</b> Dynamic</p>
2349  Description:
2350  This function allows the client to re-enable an alarm after it has been
2351  disabled by a DRV_TMR_AlarmDisable call.
2352  Precondition:
2353  The DRV_TMR_Initialize function must have been called.
2354  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2355  Parameters:
2356  handle - A valid handle, returned from DRV_TMR_Open
2357  enable - boolean to enable the current callback
2358  Returns:
2359  None
2360  Example:
2361  <code>
2362  </code>
2363  Remarks:
2364  When the driver operates in interrupts this call resolves to a device
2365  interrupt re-enable.
2366 */
2367 
2368 void
2370  DRV_HANDLE handle ,
2371  bool enable ) ;
2372 // *****************************************************************************
2373 /* Function:
2374  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2375  Summary:
2376  Updates the Timer's period.
2377  <p><b>Implementation:</b> Dynamic</p>
2378  Description:
2379  This function updates the Timer's period.
2380  Precondition:
2381  The DRV_TMR_Initialize function must have been called.
2382  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2383  Parameters:
2384  handle - A valid open-instance handle, returned from the driver's
2385  open routine
2386  value - Period value
2387  - a 16 bit value if the timer is configured in 16 bit mode
2388  - a 32 bit value if the timer is configured in 32 bit mode
2389  Returns:
2390  None.
2391  Example:
2392  <code>
2393  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2394  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2395  </code>
2396  Remarks:
2397  - The period value will be truncated to a 16 bit value if the timer is
2398  configured in 16 bit mode.
2399 */
2400 
2401 void
2403  DRV_HANDLE handle ,
2404  uint32_t value ) ;
2405 // *****************************************************************************
2406 /* Function:
2407  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2408  Summary:
2409  Provides the Timer's period.
2410  <p><b>Implementation:</b> Dynamic</p>
2411  Description:
2412  This function gets the Timer's period.
2413  Precondition:
2414  The DRV_TMR_Initialize function must have been called.
2415  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2416  Parameters:
2417  handle - A valid open-instance handle, returned from the driver's
2418  open routine
2419  Returns:
2420  Timer period value:
2421  - a 16 bit value if the timer is configured in 16 bit mode
2422  - a 32 bit value if the timer is configured in 32 bit mode
2423  Example:
2424  <code>
2425  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2426  uint32_t period;
2427  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2428  </code>
2429  Remarks:
2430  None.
2431 */
2432 
2433 uint32_t
2435  DRV_HANDLE handle ) ;
2436 // *****************************************************************************
2437 /* Function:
2438  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2439  Summary:
2440  Removes a previously set alarm.
2441  <p><b>Implementation:</b> Dynamic</p>
2442  Description:
2443  This function removes a previously set alarm.
2444  Precondition:
2445  The DRV_TMR_Initialize function must have been called.
2446  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2447  DRV_TMR_AlarmRegister function must have been called before.
2448  Parameters:
2449  handle - A valid open-instance handle, returned from the driver's
2450  open routine
2451  Returns:
2452  None.
2453  Example:
2454  <code>
2455  // Example of a key debounce check
2456  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2457  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2458  void keyPressDetect ()
2459  {
2460  // Calculate the count to be passed on from the clock input
2461  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2462  }
2463  void DebounceCheck ( uintptr_t context )
2464  {
2465  readKey = AppReadKey();
2466  if ( readKey != lastReadKey )
2467  {
2468  lastReadKey = readKey;
2469  keyCount = 0;
2470  }
2471  else
2472  {
2473  if ( keyCount > 20 )
2474  {
2475  globalKeyState = readKey;
2476  DRV_TMR_AlarmDeregister ( tmrHandle );
2477  }
2478  keyCount++;
2479  }
2480  }
2481  </code>
2482  Remarks:
2483  None.
2484 */
2485 
2486 void
2488  DRV_HANDLE handle ) ;
2489 // *****************************************************************************
2490 // *****************************************************************************
2491 // Section: TMR Driver Operation Control Functions
2492 // *****************************************************************************
2493 // *****************************************************************************
2494 // *****************************************************************************
2495 /* Function:
2496  bool DRV_TMR_Start ( DRV_HANDLE handle )
2497  Summary:
2498  Starts the Timer counting.
2499  <p><b>Implementation:</b> Static/Dynamic</p>
2500  Description:
2501  This function starts the Timer counting.
2502  Precondition:
2503  The DRV_TMR_Initialize function must have been called.
2504  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2505  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2506  Parameters:
2507  handle - A valid open-instance handle, returned from the driver's
2508  open routine
2509  Returns:
2510  - true - if the operation succeeded
2511  - false - the supplied handle is invalid or the client doesn't have
2512  the needed parameters to run (alarm callback and period )
2513  Example:
2514  <code>
2515  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2516  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2517  DRV_TMR_Start ( tmrHandle );
2518  </code>
2519  Remarks:
2520  None.
2521 */
2522 
2523 bool
2524  DRV_TMR_Start (
2525  DRV_HANDLE handle ) ;
2526 // *****************************************************************************
2527 /* Function:
2528  void DRV_TMR_Stop ( DRV_HANDLE handle )
2529  Summary:
2530  Stops the Timer from counting.
2531  <p><b>Implementation:</b> Static/Dynamic</p>
2532  Description:
2533  This function stops the running Timer from counting.
2534  Precondition:
2535  The DRV_TMR_Initialize function must have been called.
2536  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2537  Parameters:
2538  handle - A valid open-instance handle, returned from the driver's
2539  open routine
2540  Returns:
2541  None.
2542  Example:
2543  <code>
2544  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2545  DRV_TMR_Stop ( handle );
2546  </code>
2547  Remarks:
2548  None.
2549 */
2550 
2551 void
2552  DRV_TMR_Stop (
2553  DRV_HANDLE handle ) ;
2554 // *****************************************************************************
2555 // *****************************************************************************
2556 // Section: TMR Driver Operation Status Functions
2557 // *****************************************************************************
2558 // *****************************************************************************
2559 // *****************************************************************************
2560 /* Function:
2561  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
2562  Summary:
2563  Provides the status of Timer's period elapse.
2564  <p><b>Implementation:</b> Dynamic</p>
2565  Description:
2566  This function returns the number of times Timer's period has elapsed since
2567  last call to this API has made. On calling this API, the internally
2568  maintained counter will be cleared and count will be started again from next
2569  elapse.
2570  Precondition:
2571  The DRV_TMR_Initialize function must have been called.
2572  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2573  Parameters:
2574  handle - A valid handle, returned from the DRV_TMR_Open
2575  Returns:
2576  Number of times timer has elapsed since the last call.
2577  Example:
2578  <code>
2579  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2580  bool elapseStatus;
2581  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
2582  unsigned int appInternalTime = 0;
2583  Sys_Tasks()
2584  {
2585  //Timer task will be called from ISR
2586  APP_TimeUpdate_Task();
2587  //Other Tasks
2588  }
2589  void APP_TimeUpdate_Task ( void )
2590  {
2591  //We will not miss a count even though we are late
2592  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
2593  }
2594  </code>
2595  Remarks:
2596  None.
2597 */
2598 
2599 uint32_t
2601  DRV_HANDLE handle ) ;
2602 // *****************************************************************************
2603 // *****************************************************************************
2604 // Section: TMR Driver Control and Information Functions
2605 // *****************************************************************************
2606 // *****************************************************************************
2607 // *****************************************************************************
2608 /* Function:
2609  bool DRV_TMR_ClockSet
2610  (
2611  DRV_HANDLE handle,
2612  DRV_TMR_CLK_SOURCES clockSource,
2613  TMR_PRESCALE preScale
2614  )
2615  Summary:
2616  Sets the timers clock by selecting the source and prescaler.
2617  <p><b>Implementation:</b> Dynamic</p>
2618  Description:
2619  This function sets the timer clock by selecting the source and prescaler.
2620  The clock sources are device specific, refer device datasheet for supported
2621  clock sources. If unsupported clock source is passed then the behaviour of
2622  this function is unpredictable.
2623  Precondition:
2624  The DRV_TMR_Initialize function must have been called. Must have selected
2625  32-Bit timer mode if mode selection is applicable.
2626  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2627  Parameters:
2628  handle - A valid open-instance handle, returned from the driver's
2629  open routine
2630  clockSource - Clock source of the timer
2631  preScale - Timer's Prescaler divisor
2632  Returns:
2633  - true - if the operation is successful
2634  - false - either the handle is invalid or the clockSource
2635  and/or prescaler are not supported
2636  Example:
2637  <code>
2638  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2639  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
2640  </code>
2641  Remarks:
2642  None.
2643 */
2644 
2645 bool
2647  DRV_HANDLE handle ,
2648  DRV_TMR_CLK_SOURCES clockSource ,
2649  TMR_PRESCALE preScale ) ;
2650 // *****************************************************************************
2651 /* Function:
2652  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
2653  Summary:
2654  This function gets the currently selected prescaler.
2655  <p><b>Implementation:</b> Dynamic</p>
2656  Description:
2657  This function gets the currently selected prescaler.
2658  Precondition:
2659  The DRV_TMR_Initialize function must have been called.
2660  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2661  Parameters:
2662  handle - A valid open-instance handle, returned from the driver's
2663  open routine
2664  Returns:
2665  Timer prescaler.
2666  Example:
2667  <code>
2668  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2669  TMR_PRESCALE preScale;
2670  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
2671  </code>
2672  Remarks:
2673  None.
2674 */
2675 
2676 TMR_PRESCALE
2678  DRV_HANDLE handle ) ;
2679 // *****************************************************************************
2680 /* Function:
2681  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
2682  Summary:
2683  This function gets the currently selected operation mode.
2684  <p><b>Implementation:</b> Dynamic</p>
2685  Description:
2686  This function gets the currently selected 16/32 bit operation mode.
2687  Precondition:
2688  The DRV_TMR_Initialize function must have been called.
2689  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2690  Parameters:
2691  handle - A valid open-instance handle, returned from the driver's
2692  open routine
2693  Returns:
2694  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
2695  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
2696  handle.
2697  Example:
2698  <code>
2699  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2700  DRV_TMR_OPERATION_MODE operMode;
2701  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
2702  </code>
2703  Remarks:
2704  None.
2705 */
2706 
2709  DRV_HANDLE handle ) ;
2710 // *****************************************************************************
2711 /* Function:
2712  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
2713  Summary:
2714  Enables the Gate mode.
2715  <p><b>Implementation:</b> Dynamic</p>
2716  Description:
2717  This function enables the Gated mode of Timer. User can measure the duration
2718  of an external signal in this mode. Once the Gate mode is enabled, Timer
2719  will start on the raising edge of the external signal. It will keep counting
2720  until the next falling edge.
2721  Precondition:
2722  The DRV_TMR_Initialize function must have been called.
2723  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2724  Parameters:
2725  handle - A valid open-instance handle, returned from the driver's
2726  open routine
2727  Returns:
2728  - true - if the operation is successful
2729  - false - either the handle is invalid or the gate mode
2730  is not supported
2731  Example:
2732  <code>
2733  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2734  DRV_TMR_GateModeSet ( tmrHandle );
2735  </code>
2736  Remarks:
2737  None.
2738 */
2739 
2740 bool
2742  DRV_HANDLE handle ) ;
2743 // *****************************************************************************
2744 /* Function:
2745  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
2746  Summary:
2747  Enables the Gate mode.
2748  <p><b>Implementation:</b> Dynamic</p>
2749  Description:
2750  This function enables the Gated mode of Timer. User can measure the duration
2751  of an external signal in this mode. Once the Gate mode is enabled, Timer
2752  will start on the raising edge of the external signal. It will keep counting
2753  until the next falling edge.
2754  Precondition:
2755  The DRV_TMR_Initialize function must have been called.
2756  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2757  Parameters:
2758  handle - A valid open-instance handle, returned from the driver's
2759  open routine
2760  Returns:
2761  - true - if the operation is successful
2762  - false - either the handle is invalid or the gate mode
2763  is not supported
2764  Example:
2765  <code>
2766  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2767  DRV_TMR_GateModeClear ( tmrHandle );
2768  </code>
2769  Remarks:
2770  None.
2771 */
2772 
2773 bool
2775  DRV_HANDLE handle ) ;
2776 // *****************************************************************************
2777 /* Function:
2778  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
2779  Summary:
2780  Provides the Timer input frequency.
2781  <p><b>Implementation:</b> Dynamic</p>
2782  Description:
2783  This function provides the Timer input frequency. Input frequency is the
2784  clock to the Timer register and it is considering the prescaler divisor.
2785  Precondition:
2786  The DRV_TMR_Initialize function must have been called.
2787  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2788  Parameters:
2789  handle - A valid open-instance handle, returned from the driver's
2790  open routine
2791  Returns:
2792  32-bit value corresponding to the running frequency.
2793  If Timer clock source is external, then this function returns 0.
2794  Example:
2795  <code>
2796  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2797  uint32_t clkFreqHz;
2798  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2799  </code>
2800  Remarks:
2801  On most processors, the Timer's base frequency is the same as the peripheral
2802  bus clock.
2803 */
2804 
2805 uint32_t
2807  DRV_HANDLE handle ) ;
2808 // *****************************************************************************
2809 /* Function:
2810  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
2811  (
2812  DRV_HANDLE handle,
2813  DRV_TMR_DIVIDER_RANGE* pDivRange
2814  )
2815  Summary:
2816  Returns the Timer divider values.
2817  <p><b>Implementation:</b> Dynamic</p>
2818  Description:
2819  This function provides the Timer operating mode and divider range.
2820  Precondition:
2821  The DRV_TMR_Initialize function must have been called.
2822  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2823  Parameters:
2824  handle - A valid open-instance handle, returned from the driver's
2825  open routine
2826  pDivRange - Address to store the timer divider range.
2827  Returns:
2828  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
2829  The pDivRange is updated with the supported range values.
2830  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
2831  Example:
2832  <code>
2833  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2834  DRV_TMR_OPERATION_MODE timerMode;
2835  DRV_TMR_DIVIDER_RANGE timerRange;
2836  DRV_TMR_DividerRangeGet(handle, &timerRange);
2837  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2838  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
2839  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
2840  </code>
2841  Remarks:
2842  None.
2843 */
2844 
2847  DRV_HANDLE handle ,
2848  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
2849 // *****************************************************************************
2850 // *****************************************************************************
2851 // Section: File includes for the APIs which are required for backward
2852 // compatibility.
2853 // *****************************************************************************
2854 // *****************************************************************************
2855 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
2856 /*******************************************************************************
2857  Timer Device Driver Interface Definition
2858  Company:
2859  Microchip Technology Inc.
2860  File Name:
2861  drv_tmr_compatibility.h
2862  Summary:
2863  Timer device driver interface header file.
2864  Description:
2865  This header file contains macro definition for APIs which will be deprecated
2866  later. This header file is included in drv_tmr.h.
2867 *******************************************************************************/
2868 //DOM-IGNORE-BEGIN
2869 /*******************************************************************************
2870 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2871 Microchip licenses to you the right to use, modify, copy and distribute
2872 Software only when embedded on a Microchip microcontroller or digital signal
2873 controller that is integrated into your product or third party product
2874 (pursuant to the sublicense terms in the accompanying license agreement).
2875 You should refer to the license agreement accompanying this Software for
2876 additional information regarding your rights and obligations.
2877 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2878 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2879 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2880 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2881 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2882 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2883 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2884 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2885 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2886 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2887 *******************************************************************************/
2888 //DOM-IGNORE-END
2889 #ifndef _DRV_TMR_DEPRECATED_H
2890 #define _DRV_TMR_DEPRECATED_H
2891 // *****************************************************************************
2892 // *****************************************************************************
2893 // Section: File includes
2894 // *****************************************************************************
2895 // *****************************************************************************
2896 // *****************************************************************************
2897 /* Function:
2898  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
2899  Summary:
2900  Maintains the driver's state machine, processes the events and implements
2901  its ISR.
2902  <p><b>Implementation:</b> Dynamic</p>
2903  Description:
2904  This function is used to maintain the driver's internal state machine and
2905  processes the timer events in interrupt-driven implementations
2906  (DRV_TMR_INTERRUPT_MODE == true).
2907  Precondition:
2908  The DRV_TMR_Initialize function must have been called for the specified Timer
2909  driver instance.
2910  Parameters:
2911  object - Object handle for the specified driver instance (returned from
2912  DRV_TMR_Initialize)
2913  Returns:
2914  None
2915  Example:
2916  <code>
2917  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
2918  {
2919  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
2920  }
2921  </code>
2922  Remarks:
2923  This function is normally not called directly by an application.
2924  It is called by the timer driver raw ISR.
2925  This function will execute in an ISR context and will never block or access any
2926  resources that may cause it to block.
2927 
2928  This function will be deprecated later, so avoid using it as much as possible.
2929  Use generic function "DRV_TMR_Tasks" instead of this.
2930 */
2931 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
2932 // *****************************************************************************
2933 /* Function:
2934  void DRV_TMR_CounterValue16BitSet
2935  (
2936  DRV_HANDLE handle,
2937  uint16_t counterPeriod
2938  )
2939  Summary:
2940  Updates the 16-bit Timer's counter register.
2941  <p><b>Implementation:</b> Dynamic</p>
2942  Description:
2943  This function updates the 16-bit Timer's value in the counter register. This
2944  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
2945  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
2946  DRV_TMR_CounterValue32BitSet function.
2947  Precondition:
2948  The DRV_TMR_Initialize function must have been called. Must have selected
2949  16-Bit timer mode if mode selection is applicable.
2950  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2951  Parameters:
2952  handle - A valid open-instance handle, returned from the driver's
2953  open routine
2954  counterPeriod - 16-bit counter period value
2955  Returns:
2956  None.
2957  Example:
2958  <code>
2959  //Example to use timer for precision time measurement
2960  //without configuring an alarm (interrupt based)
2961  char appState = 0;
2962  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2963 
2964  switch ( appState )
2965  {
2966  case 0:
2967  //Calculate and set the counter period
2968  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2969 
2970  //counter starts
2971  DRV_TMR_Start ( tmrHandle );
2972 
2973  //Trigger an application operation
2974  app_trigger_operation();
2975 
2976  //Check for time-out in the next state
2977  appState++;
2978  case 1:
2979  //Overflows and stops at 0 if no alarm is set
2980  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
2981  {
2982  //Time-out
2983  return false;
2984  }
2985  else if ( app_operation_isComplete( ) )
2986  {
2987  //Operation is complete before time-out
2988  return true;
2989  }
2990  </code>
2991  Remarks:
2992  This function will be deprecated later, so avoid using it as much as possible.
2993  Use generic function "DRV_TMR_CounterValueSet" instead of this.
2994 */
2995 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
2996 // *****************************************************************************
2997 /* Function:
2998  void DRV_TMR_CounterValue32BitSet
2999  (
3000  DRV_HANDLE handle,
3001  uint32_t counterPeriod
3002  )
3003  Summary:
3004  Updates the 32-bit Timer's counter register.
3005  <p><b>Implementation:</b> Dynamic</p>
3006  Description:
3007  This function updates the 32-bit Timer's value in the counter register. This
3008  is valid only if the 32-bit mode of the timer is selected Otherwise use
3009  DRV_TMR_CounterValue16BitSet function.
3010  Precondition:
3011  The DRV_TMR_Initialize function must have been called. Must have selected
3012  32-Bit timer mode.
3013  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3014  Parameters:
3015  handle - A valid open-instance handle, returned from the driver's
3016  open routine
3017  counterPeriod - 32-bit counter period value
3018  Returns:
3019  None.
3020  Example:
3021  <code>
3022  //Example to use timer for precision time measurement
3023  //without configuring an alarm (interrupt based)
3024  char appState = 0;
3025  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3026 
3027  switch ( appState )
3028  {
3029  case 0:
3030  //Calculate and set the counter period
3031  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3032 
3033  //counter starts
3034  DRV_TMR_Start ( tmrHandle );
3035 
3036  //Trigger an application operation against which we want to use the time-out
3037  app_trigger_operation();
3038 
3039  //Check for time-out in the next state
3040  appState++;
3041  case 1:
3042  //Overflows and stops at 0 if no alarm is set
3043  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3044  {
3045  //Time-out
3046  return false;
3047  }
3048  else if ( app_operation_isComplete( ) )
3049  {
3050  //Operation is complete before time-out
3051  return true;
3052  }
3053  </code>
3054  Remarks:
3055  In most of the devices only even numbered instances of timer supports
3056  32-bit mode.
3057  This function will be deprecated later, so avoid using it as much as possible.
3058  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3059 */
3060 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3061 // *****************************************************************************
3062 /* Function:
3063  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3064  Summary:
3065  Reads the 16-bit Timer's counter register.
3066  <p><b>Implementation:</b> Dynamic</p>
3067  Description:
3068  This function returns the 16-bit Timer's value in the counter register. This
3069  is valid only if the 16-bit mode of the timer is selected.
3070  Otherwise use DRV_TMR_CounterValue32BitGet function.
3071  Precondition:
3072  The DRV_TMR_Initialize function must have been called. Must have selected
3073  16-Bit timer mode if mode selection is applicable.
3074  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3075  Parameters:
3076  handle - A valid open-instance handle, returned from the driver's
3077  open routine
3078 
3079  Returns:
3080  Timer period in 16-bit mode.
3081  Example:
3082  <code>
3083  //Example to use timer for precision time measurement
3084  //without configuring an alarm (interrupt based)
3085  char appState = 0;
3086  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3087 
3088  switch ( appState )
3089  {
3090  case 0:
3091  //Calculate and set the counter period
3092  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3093 
3094  //counter starts
3095  DRV_TMR_Start ( tmrHandle );
3096 
3097  //Trigger an application operation
3098  app_trigger_operation();
3099 
3100  //Check for time-out in the next state
3101  appState++;
3102  case 1:
3103  //Overflows and stops at 0 if no alarm is set
3104  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3105  {
3106  //Time-out
3107  return false;
3108  }
3109  else if ( app_operation_isComplete( ) )
3110  {
3111  //Operation is complete before time-out
3112  return true;
3113  }
3114  </code>
3115  Remarks:
3116  This function will be deprecated later, so avoid using it as much as possible.
3117  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3118 */
3119 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3120 // *****************************************************************************
3121 /* Function:
3122  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3123  Summary:
3124  Reads the 32-bit Timer's counter register.
3125  <p><b>Implementation:</b> Dynamic</p>
3126  Description:
3127  This function returns the 32-bit Timer's value in the counter register. This
3128  is valid only if the 32-bit mode of the timer is selected Otherwise use
3129  DRV_TMR_CounterValue16BitGet function.
3130  Precondition:
3131  The DRV_TMR_Initialize function must have been called. Must have selected
3132  32-Bit timer mode.
3133  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3134  Parameters:
3135  handle - A valid open-instance handle, returned from the driver's
3136  open routine
3137 
3138  Returns:
3139  32-Bit Counter value.
3140  Example:
3141  <code>
3142  //Example to use timer for precision time measurement
3143  //without configuring an alarm (interrupt based)
3144  char appState = 0;
3145  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3146 
3147  switch ( appState )
3148  {
3149  case 0:
3150  //Calculate and set the counter period
3151  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3152 
3153  //counter starts
3154  DRV_TMR_Start ( tmrHandle );
3155 
3156  //Trigger an application operation
3157  app_trigger_operation();
3158 
3159  //Check for time-out in the next state
3160  appState++;
3161  case 1:
3162  //Overflows and stops at 0 if no alarm is set
3163  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3164  {
3165  //Time-out
3166  return false;
3167  }
3168  else if ( app_operation_isComplete( ) )
3169  {
3170  //Operation is complete before time-out
3171  return true;
3172  }
3173  </code>
3174  Remarks:
3175  In most of the devices only even numbered instances of timer supports
3176  32-bit mode.
3177  This function will be deprecated later, so avoid using it as much as possible.
3178  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3179 */
3180 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3181 // *****************************************************************************
3182 /* Function:
3183  void DRV_TMR_Alarm16BitRegister
3184  (
3185  DRV_HANDLE handle,
3186  uint16_t period,
3187  bool isPeriodic,
3188  uintptr_t context,
3189  DRV_TMR_CALLBACK callBack
3190  )
3191  Summary:
3192  Sets up an alarm.
3193  <p><b>Implementation:</b> Dynamic</p>
3194  Description:
3195  This function sets up an alarm, allowing the client to receive a callback
3196  from the driver when the counter period elapses. Alarms can be one-shot or
3197  periodic. This API is valid only if the 16-bit mode of the timer is
3198  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3199  Precondition:
3200  The DRV_TMR_Initialize function must have been called. Must have selected
3201  16-Bit timer mode if mode selection is applicable.
3202  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3203  Parameters:
3204  handle - A valid handle, returned from DRV_TMR_Open
3205  period - 16-bit period which will be loaded into the Timer hardware register.
3206 
3207  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3208 
3209  context - A reference, call back function will be called with the same
3210  reference.
3211 
3212  callBack - A call back function which will be called on period elapse.
3213 
3214  Returns:
3215  None
3216  Example:
3217  <code>
3218  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3219 
3220  void setupTask ()
3221  {
3222  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3223 
3224  // Calculate the count to be passed on from the clock input
3225  //Periodically toggle LED
3226  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3227  ToggleLedCallBack );
3228  }
3229 
3230  void ToggleLedCallBack ( uintptr_t context )
3231  {
3232  //Toggle
3233  }
3234  </code>
3235  Remarks:
3236  This function will be deprecated later, so avoid using it as much as possible.
3237  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3238 */
3239 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3240 // *****************************************************************************
3241 /* Function:
3242  void DRV_TMR_Alarm32BitRegister
3243  (
3244  DRV_HANDLE handle,
3245  uint32_t period,
3246  bool isPeriodic,
3247  uintptr_t context,
3248  DRV_TMR_CALLBACK callBack
3249  )
3250  Summary:
3251  Sets up an alarm.
3252  <p><b>Implementation:</b> Dynamic</p>
3253  Description:
3254  This function sets up an alarm, allowing the client to receive a callback
3255  from the driver when the counter period elapses. Alarms can be one-shot or
3256  periodic. This API is valid only if the 32-bit mode of the timer is
3257  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3258  Precondition:
3259  The DRV_TMR_Initialize function must have been called. Must have selected
3260  32-Bit timer mode.
3261  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3262  Parameters:
3263  handle - A valid handle, returned from DRV_TMR_Open
3264  period - 32-bit period which will be loaded into the Timer hardware register.
3265 
3266  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3267 
3268  context - A reference, call back function will be called with the same
3269  reference.
3270 
3271  callBack - A call back function which will be called on period elapse.
3272 
3273  Returns:
3274  None
3275  Example:
3276  <code>
3277  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3278 
3279  void setupTask ()
3280  {
3281  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3282 
3283  // Calculate the count to be passed on from the clock input
3284  //Periodically toggle LED
3285  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3286  ToggleLedCallBack );
3287  }
3288 
3289  void ToggleLedCallBack ( uintptr_t context )
3290  {
3291  //Toggle
3292  }
3293  </code>
3294  Remarks:
3295  In most of the devices only even numbered instances of timer supports
3296  32-bit mode.
3297  This function will be deprecated later, so avoid using it as much as possible.
3298  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3299 */
3300 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3301 // *****************************************************************************
3302 /* Function:
3303  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3304  Summary:
3305  Updates the 16-bit Timer's period.
3306  <p><b>Implementation:</b> Dynamic</p>
3307  Description:
3308  This function updates the 16-bit Timer's period. This API is valid only if
3309  the 16-bit mode of the timer is selected
3310  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3311  Precondition:
3312  The DRV_TMR_Initialize function must have been called. Must have selected
3313  16-Bit timer mode if mode selection is applicable.
3314  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3315  Parameters:
3316  handle - A valid open-instance handle, returned from the driver's
3317  open routine
3318  value - 16-bit Period value
3319  Returns:
3320  None.
3321  Example:
3322  <code>
3323  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3324  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3325  </code>
3326  Remarks:
3327  This function will be deprecated later, so avoid using it as much as possible.
3328  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3329 */
3330 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3331 // *****************************************************************************
3332 /* Function:
3333  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3334  Summary:
3335  Updates the 32-bit Timer's period.
3336  <p><b>Implementation:</b> Dynamic</p>
3337  Description:
3338  This function updates the 32-bit Timer's period. This API is valid only if
3339  the 32-bit mode of the timer is selected
3340  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3341  Precondition:
3342  The DRV_TMR_Initialize unction must have been called. Must have selected
3343  32-Bit timer mode.
3344  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3345  Parameters:
3346  handle - A valid open-instance handle, returned from the driver's
3347  open routine
3348  period - 32-bit Period value
3349  Returns:
3350  None.
3351  Example:
3352  <code>
3353  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3354  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3355  </code>
3356  Remarks:
3357  In most of the devices only even numbered instances of timer supports
3358  32-bit mode.
3359  This function will be deprecated later, so avoid using it as much as possible.
3360  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3361 */
3362 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3363 // *****************************************************************************
3364 /* Function:
3365  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3366  Summary:
3367  Provides the 16-bit Timer's period.
3368  <p><b>Implementation:</b> Dynamic</p>
3369  Description:
3370  This function gets the 16-bit Timer's period. This API is valid only if
3371  the 16-bit mode of the timer is selected.
3372  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3373  Precondition:
3374  The DRV_TMR_Initialize function must have been called. Must have selected
3375  16-Bit timer mode if mode selection is applicable.
3376  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3377  Parameters:
3378  handle - A valid open-instance handle, returned from the driver's
3379  open routine
3380  Returns:
3381  16-bit timer period value
3382  Example:
3383  <code>
3384  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3385  uint16_t period;
3386 
3387  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3388  </code>
3389  Remarks:
3390  This function will be deprecated later, so avoid using it as much as possible.
3391  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3392 */
3393 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3394 // *****************************************************************************
3395 /* Function:
3396  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3397  Summary:
3398  Provides the 32-bit Timer's period.
3399  <p><b>Implementation:</b> Dynamic</p>
3400  Description:
3401  This function gets the 32-bit Timer's period. This API is valid only if
3402  the 32-bit mode of the timer is selected
3403  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3404  Precondition:
3405  The DRV_TMR_Initialize function must have been called. Must have selected
3406  32-Bit timer mode.
3407  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3408  Parameters:
3409  handle - A valid open-instance handle, returned from the driver's
3410  open routine
3411  Returns:
3412  32-bit Timer period value.
3413  Example:
3414  <code>
3415  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3416  uint32_t period;
3417  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3418  </code>
3419  Remarks:
3420  In most of the devices only even numbered instances of timer supports
3421  32-bit mode.
3422  This function will be deprecated later, so avoid using it as much as possible.
3423  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3424 */
3425 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3426 // *****************************************************************************
3427 /* Function:
3428  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3429  Summary:
3430  Removes a previously set alarm.
3431  <p><b>Implementation:</b> Dynamic</p>
3432  Description:
3433  This function removes a previously set alarm. This API is valid only if
3434  the 16-bit mode of the timer is selected
3435  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3436  Precondition:
3437  The DRV_TMR_Initialize function must have been called. Must have selected
3438  16-Bit timer mode if mode selection is applicable.
3439  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3440 
3441  DRV_TMR_Alarm16BitRegister function must have been called before.
3442  Parameters:
3443  handle - A valid open-instance handle, returned from the driver's
3444  open routine
3445  Returns:
3446  None.
3447  Example:
3448  <code>
3449  //Example of a key debounce check
3450 
3451  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3452  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3453  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3454 
3455  void keyPressDetect ()
3456  {
3457  // Calculate the count to be passed on from the clock input
3458  //Periodically toggle LED
3459  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3460  DebounceCheck );
3461  }
3462 
3463  void DebounceCheck ( uintptr_t context )
3464  {
3465  readKey = AppReadKey();
3466 
3467  if ( readKey != lastReadKey )
3468  {
3469  lastReadKey = readKey;
3470  keyCount = 0;
3471  }
3472  else
3473  {
3474  if ( keyCount > 20 )
3475  {
3476  globalKeyState = readKey;
3477  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3478  }
3479  keyCount++;
3480  }
3481  }
3482  </code>
3483  Remarks:
3484  This function will be deprecated later, so avoid using it as much as possible.
3485  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3486 */
3487 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3488 // *****************************************************************************
3489 /* Function:
3490  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3491  Summary:
3492  Removes a previously set alarm.
3493  <p><b>Implementation:</b> Dynamic</p>
3494  Description:
3495  This function removes a previously set alarm. This API is valid only if
3496  the 32-bit mode of the timer is selected
3497  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3498  Precondition:
3499  The DRV_TMR_Initialize function must have been called. Must have selected
3500  32-Bit timer mode if mode selection is applicable.
3501  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3502 
3503  DRV_TMR_Alarm32BitRegister function must have been called before.
3504  Parameters:
3505  handle - A valid open-instance handle, returned from the driver's
3506  open routine
3507  Returns:
3508  None.
3509  Example:
3510  <code>
3511  //Example of a key debounce check
3512 
3513  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3514  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3515  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3516 
3517  void keyPressDetect ( void )
3518  {
3519  // Calculate the count to be passed on from the clock input
3520  //Periodically check the key status
3521  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
3522  DebounceCheck );
3523  }
3524 
3525  void DebounceCheck ( uintptr_t context )
3526  {
3527  readKey = AppReadKey();
3528 
3529  if ( readKey != lastReadKey )
3530  {
3531  lastReadKey = readKey;
3532  keyCount = 0;
3533  }
3534  else
3535  {
3536  if ( keyCount > 20 )
3537  {
3538  //Key is stable now
3539  globalKeyState = readKey;
3540  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
3541  }
3542  keyCount++;
3543  }
3544  }
3545  </code>
3546  Remarks:
3547  In most of the devices only even numbered instances of timer supports
3548  32-bit mode.
3549  This function will be deprecated later, so avoid using it as much as possible.
3550  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3551 */
3552 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3553  // #ifndef _DRV_TMR_DEPRECATED_H
3554 /*******************************************************************************
3555  End of File
3556 */
3557 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
3558 /* CLOSE_FILE Include File */
3559 
3560 //DOM-IGNORE-BEGIN
3561 //DOM-IGNORE-END
3562  // #ifndef _DRV_TMR_H
3563 /*******************************************************************************
3564  End of File
3565 */
3566 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
3567 /* CLOSE_FILE Include File */
3568 
3569 #include "peripheral/tmr/plib_tmr.h"
3570 #include "peripheral/int/plib_int.h"
3571 // maximum divider value for 32 bit operation mode
3572 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
3573 // minimum divider value for 32 bit operation mode
3574 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
3575 // maximum divider value for 16 bit operation mode
3576 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
3577 // minimum divider value for 16 bit operation mode
3578 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
3579 // *****************************************************************************
3580 // *****************************************************************************
3581 // Section: Interface Headers for Instance 0 for the static driver
3582 // *****************************************************************************
3583 // *****************************************************************************
3584 
3585 void
3586  DRV_TMR0_Initialize ( void ) ;
3587 
3588 bool
3589  DRV_TMR0_Start ( void ) ;
3590 
3591 void
3592  DRV_TMR0_Stop ( void ) ;
3593 
3594 static inline void
3596  {
3597  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
3598  DRV_TMR0_Stop () ;
3599  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
3600  app_64zqendz ( 2 ) ; /* 30 */
3601  }
3602 
3603 static inline SYS_STATUS
3605 {
3606  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
3607  /* Return the status as ready always */
3608  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
3609  app_64zqendz ( 4 ) ; /* 30 */
3610  return
3611  SYS_STATUS_READY ;
3612 }
3613 
3614 static inline void
3615  DRV_TMR0_Open ( void )
3616  {
3617  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
3618  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
3619  app_64zqendz ( 6 ) ; /* 30 */
3620  }
3621 
3623  DRV_TMR0_ClientStatus ( void ) ;
3624 
3625 static inline DRV_TMR_OPERATION_MODE
3627 {
3628  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
3629  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
3630  app_64zqendz ( 8 ) ; /* 30 */
3631  return
3633 }
3634 
3635 static inline void
3637  {
3638  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
3639  DRV_TMR0_Stop () ;
3640  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
3641  app_64zqendz ( 10 ) ; /* 30 */
3642  }
3643 
3644 bool
3646  DRV_TMR_CLK_SOURCES clockSource ,
3647  TMR_PRESCALE prescale ) ;
3648 
3649 void
3651  uint32_t value ) ;
3652 
3653 uint32_t
3654  DRV_TMR0_CounterValueGet ( void ) ;
3655 
3656 void
3657  DRV_TMR0_CounterClear ( void ) ;
3658 
3659 TMR_PRESCALE
3660  DRV_TMR0_PrescalerGet ( void ) ;
3661 
3662 void
3664  uint32_t value ) ;
3665 
3666 uint32_t
3667  DRV_TMR0_PeriodValueGet ( void ) ;
3668 
3669 void
3670  DRV_TMR0_StopInIdleDisable ( void ) ;
3671 
3672 void
3673  DRV_TMR0_StopInIdleEnable ( void ) ;
3674 
3675 static inline void
3677  {
3678  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
3679  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
3680  app_64zqendz ( 12 ) ; /* 30 */
3681  }
3682 
3683 uint32_t
3684  DRV_TMR0_CounterFrequencyGet ( void ) ;
3685 
3688  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3689 // *****************************************************************************
3690 // *****************************************************************************
3691 // Section: Interface Headers for Instance 1 for the static driver
3692 // *****************************************************************************
3693 // *****************************************************************************
3694 
3695 void
3696  DRV_TMR1_Initialize ( void ) ;
3697 
3698 bool
3699  DRV_TMR1_Start ( void ) ;
3700 
3701 void
3702  DRV_TMR1_Stop ( void ) ;
3703 
3704 static inline void
3706  {
3707  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
3708  DRV_TMR1_Stop () ;
3709  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
3710  app_64zqendz ( 14 ) ; /* 30 */
3711  }
3712 
3713 static inline SYS_STATUS
3715 {
3716  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
3717  /* Return the status as ready always */
3718  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
3719  app_64zqendz ( 16 ) ; /* 30 */
3720  return
3721  SYS_STATUS_READY ;
3722 }
3723 
3724 static inline void
3725  DRV_TMR1_Open ( void )
3726  {
3727  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
3728  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
3729  app_64zqendz ( 18 ) ; /* 30 */
3730  }
3731 
3733  DRV_TMR1_ClientStatus ( void ) ;
3734 
3735 static inline DRV_TMR_OPERATION_MODE
3737 {
3738  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
3739  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
3740  app_64zqendz ( 20 ) ; /* 30 */
3741  return
3743 }
3744 
3745 static inline void
3747  {
3748  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
3749  DRV_TMR1_Stop () ;
3750  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
3751  app_64zqendz ( 22 ) ; /* 30 */
3752  }
3753 
3754 bool
3756  DRV_TMR_CLK_SOURCES clockSource ,
3757  TMR_PRESCALE prescale ) ;
3758 
3759 void
3761  uint32_t value ) ;
3762 
3763 uint32_t
3764  DRV_TMR1_CounterValueGet ( void ) ;
3765 
3766 void
3767  DRV_TMR1_CounterClear ( void ) ;
3768 
3769 TMR_PRESCALE
3770  DRV_TMR1_PrescalerGet ( void ) ;
3771 
3772 void
3774  uint32_t value ) ;
3775 
3776 uint32_t
3777  DRV_TMR1_PeriodValueGet ( void ) ;
3778 
3779 void
3780  DRV_TMR1_StopInIdleDisable ( void ) ;
3781 
3782 void
3783  DRV_TMR1_StopInIdleEnable ( void ) ;
3784 
3785 static inline void
3787  {
3788  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
3789  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
3790  app_64zqendz ( 24 ) ; /* 30 */
3791  }
3792 
3793 uint32_t
3794  DRV_TMR1_CounterFrequencyGet ( void ) ;
3795 
3798  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3799 // *****************************************************************************
3800 // *****************************************************************************
3801 // Section: Interface Headers for Instance 2 for the static driver
3802 // *****************************************************************************
3803 // *****************************************************************************
3804 
3805 void
3806  DRV_TMR2_Initialize ( void ) ;
3807 
3808 bool
3809  DRV_TMR2_Start ( void ) ;
3810 
3811 void
3812  DRV_TMR2_Stop ( void ) ;
3813 
3814 static inline void
3816  {
3817  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
3818  DRV_TMR2_Stop () ;
3819  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
3820  app_64zqendz ( 26 ) ; /* 30 */
3821  }
3822 
3823 static inline SYS_STATUS
3825 {
3826  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
3827  /* Return the status as ready always */
3828  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
3829  app_64zqendz ( 28 ) ; /* 30 */
3830  return
3831  SYS_STATUS_READY ;
3832 }
3833 
3834 static inline void
3835  DRV_TMR2_Open ( void )
3836  {
3837  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
3838  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
3839  app_64zqendz ( 30 ) ; /* 30 */
3840  }
3841 
3843  DRV_TMR2_ClientStatus ( void ) ;
3844 
3845 static inline DRV_TMR_OPERATION_MODE
3847 {
3848  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
3849  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
3850  app_64zqendz ( 32 ) ; /* 30 */
3851  return
3853 }
3854 
3855 static inline void
3857  {
3858  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
3859  DRV_TMR2_Stop () ;
3860  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
3861  app_64zqendz ( 34 ) ; /* 30 */
3862  }
3863 
3864 bool
3866  DRV_TMR_CLK_SOURCES clockSource ,
3867  TMR_PRESCALE prescale ) ;
3868 
3869 void
3871  uint32_t value ) ;
3872 
3873 uint32_t
3874  DRV_TMR2_CounterValueGet ( void ) ;
3875 
3876 void
3877  DRV_TMR2_CounterClear ( void ) ;
3878 
3879 TMR_PRESCALE
3880  DRV_TMR2_PrescalerGet ( void ) ;
3881 
3882 void
3884  uint32_t value ) ;
3885 
3886 uint32_t
3887  DRV_TMR2_PeriodValueGet ( void ) ;
3888 
3889 void
3890  DRV_TMR2_StopInIdleDisable ( void ) ;
3891 
3892 void
3893  DRV_TMR2_StopInIdleEnable ( void ) ;
3894 
3895 static inline void
3897  {
3898  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
3899  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
3900  app_64zqendz ( 36 ) ; /* 30 */
3901  }
3902 
3903 uint32_t
3904  DRV_TMR2_CounterFrequencyGet ( void ) ;
3905 
3908  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3909 // *****************************************************************************
3910 // *****************************************************************************
3911 // Section: Interface Headers for Instance 3 for the static driver
3912 // *****************************************************************************
3913 // *****************************************************************************
3914 
3915 void
3916  DRV_TMR3_Initialize ( void ) ;
3917 
3918 bool
3919  DRV_TMR3_Start ( void ) ;
3920 
3921 void
3922  DRV_TMR3_Stop ( void ) ;
3923 
3924 static inline void
3926  {
3927  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
3928  DRV_TMR3_Stop () ;
3929  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
3930  app_64zqendz ( 38 ) ; /* 30 */
3931  }
3932 
3933 static inline SYS_STATUS
3935 {
3936  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
3937  /* Return the status as ready always */
3938  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
3939  app_64zqendz ( 40 ) ; /* 30 */
3940  return
3941  SYS_STATUS_READY ;
3942 }
3943 
3944 static inline void
3945  DRV_TMR3_Open ( void )
3946  {
3947  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
3948  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
3949  app_64zqendz ( 42 ) ; /* 30 */
3950  }
3951 
3953  DRV_TMR3_ClientStatus ( void ) ;
3954 
3955 static inline DRV_TMR_OPERATION_MODE
3957 {
3958  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
3959  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
3960  app_64zqendz ( 44 ) ; /* 30 */
3961  return
3963 }
3964 
3965 static inline void
3967  {
3968  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
3969  DRV_TMR3_Stop () ;
3970  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
3971  app_64zqendz ( 46 ) ; /* 30 */
3972  }
3973 
3974 bool
3976  DRV_TMR_CLK_SOURCES clockSource ,
3977  TMR_PRESCALE prescale ) ;
3978 
3979 void
3981  uint32_t value ) ;
3982 
3983 uint32_t
3984  DRV_TMR3_CounterValueGet ( void ) ;
3985 
3986 void
3987  DRV_TMR3_CounterClear ( void ) ;
3988 
3989 TMR_PRESCALE
3990  DRV_TMR3_PrescalerGet ( void ) ;
3991 
3992 void
3994  uint32_t value ) ;
3995 
3996 uint32_t
3997  DRV_TMR3_PeriodValueGet ( void ) ;
3998 
3999 void
4000  DRV_TMR3_StopInIdleDisable ( void ) ;
4001 
4002 void
4003  DRV_TMR3_StopInIdleEnable ( void ) ;
4004 
4005 static inline void
4007  {
4008  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4009  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4010  app_64zqendz ( 48 ) ; /* 30 */
4011  }
4012 
4013 uint32_t
4014  DRV_TMR3_CounterFrequencyGet ( void ) ;
4015 
4018  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4019 // *****************************************************************************
4020 // *****************************************************************************
4021 // Section: Interface Headers for Instance 4 for the static driver
4022 // *****************************************************************************
4023 // *****************************************************************************
4024 
4025 void
4026  DRV_TMR4_Initialize ( void ) ;
4027 
4028 bool
4029  DRV_TMR4_Start ( void ) ;
4030 
4031 void
4032  DRV_TMR4_Stop ( void ) ;
4033 
4034 static inline void
4036  {
4037  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4038  DRV_TMR4_Stop () ;
4039  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4040  app_64zqendz ( 50 ) ; /* 30 */
4041  }
4042 
4043 static inline SYS_STATUS
4045 {
4046  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4047  /* Return the status as ready always */
4048  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4049  app_64zqendz ( 52 ) ; /* 30 */
4050  return
4051  SYS_STATUS_READY ;
4052 }
4053 
4054 static inline void
4055  DRV_TMR4_Open ( void )
4056  {
4057  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4058  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4059  app_64zqendz ( 54 ) ; /* 30 */
4060  }
4061 
4063  DRV_TMR4_ClientStatus ( void ) ;
4064 
4065 static inline DRV_TMR_OPERATION_MODE
4067 {
4068  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4069  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4070  app_64zqendz ( 56 ) ; /* 30 */
4071  return
4073 }
4074 
4075 static inline void
4077  {
4078  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4079  DRV_TMR4_Stop () ;
4080  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4081  app_64zqendz ( 58 ) ; /* 30 */
4082  }
4083 
4084 bool
4086  DRV_TMR_CLK_SOURCES clockSource ,
4087  TMR_PRESCALE prescale ) ;
4088 
4089 void
4091  uint32_t value ) ;
4092 
4093 uint32_t
4094  DRV_TMR4_CounterValueGet ( void ) ;
4095 
4096 void
4097  DRV_TMR4_CounterClear ( void ) ;
4098 
4099 TMR_PRESCALE
4100  DRV_TMR4_PrescalerGet ( void ) ;
4101 
4102 void
4104  uint32_t value ) ;
4105 
4106 uint32_t
4107  DRV_TMR4_PeriodValueGet ( void ) ;
4108 
4109 void
4110  DRV_TMR4_StopInIdleDisable ( void ) ;
4111 
4112 void
4113  DRV_TMR4_StopInIdleEnable ( void ) ;
4114 
4115 static inline void
4117  {
4118  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4119  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4120  app_64zqendz ( 60 ) ; /* 30 */
4121  }
4122 
4123 uint32_t
4124  DRV_TMR4_CounterFrequencyGet ( void ) ;
4125 
4128  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4129  // #ifndef _DRV_TMR_STATIC_H
4130 /*******************************************************************************
4131  End of File
4132 */
4133 
4134 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4135 /* CLOSE_FILE Include File */
4136 
4137 #include "peripheral/int/plib_int.h"
4138 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4139 /*******************************************************************************
4140  PMP Driver Interface Declarations for Static Single Instance Driver
4141  Company:
4142  Microchip Technology Inc.
4143  File Name:
4144  drv_pmp_static.h
4145  Summary:
4146  PMP driver interface declarations for the static single instance driver.
4147  Description:
4148  The PMP device driver provides a simple interface to manage the PMP
4149  modules on Microchip microcontrollers. This file defines the interface
4150  Declarations for the PMP driver.
4151 
4152  Remarks:
4153  Static interfaces incorporate the driver instance number within the names
4154  of the routines, eliminating the need for an object ID or object handle.
4155 
4156  Static single-open interfaces also eliminate the need for the open handle.
4157 *******************************************************************************/
4158 //DOM-IGNORE-BEGIN
4159 /*******************************************************************************
4160 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4161 Microchip licenses to you the right to use, modify, copy and distribute
4162 Software only when embedded on a Microchip microcontroller or digital signal
4163 controller that is integrated into your product or third party product
4164 (pursuant to the sublicense terms in the accompanying license agreement).
4165 You should refer to the license agreement accompanying this Software for
4166 additional information regarding your rights and obligations.
4167 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4168 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4169 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4170 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4171 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4172 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4173 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4174 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4175 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4176 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4177 *******************************************************************************/
4178 //DOM-IGNORE-END
4179 #ifndef _DRV_PMP_STATIC_H
4180 #define _DRV_PMP_STATIC_H
4181 #include "peripheral/pmp/plib_pmp.h"
4182 // *****************************************************************************
4183 // *****************************************************************************
4184 // Section: Interface Headers for Instance 0 for the static driver
4185 // *****************************************************************************
4186 // *****************************************************************************
4187 
4188 void
4189  DRV_PMP0_Initialize ( void ) ;
4190 
4191 void
4192  DRV_PMP0_ModeConfig ( void ) ;
4193 
4194 void
4196  PMP_DATA_WAIT_STATES dataWait ,
4197  PMP_STROBE_WAIT_STATES strobeWait ,
4198  PMP_DATA_HOLD_STATES dataHold ) ;
4199 
4200 uint8_t
4201  DRV_PMP0_Read ( void ) ;
4202 
4203 void
4204  DRV_PMP0_Write (
4205  uint8_t data ) ;
4206  // #ifndef _DRV_PMP_STATIC_H
4207 /*******************************************************************************
4208  End of File
4209 */
4210 
4211 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4212 /* CLOSE_FILE Include File */
4213 
4214 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4215 /*******************************************************************************
4216  USART Driver Interface Declarations for Static Single Instance Driver
4217  Company:
4218  Microchip Technology Inc.
4219  File Name:
4220  drv_usart_static.h
4221  Summary:
4222  USART driver interface declarations for the static single instance driver.
4223  Description:
4224  The USART device driver provides a simple interface to manage the USART
4225  modules on Microchip microcontrollers. This file defines the interface
4226  Declarations for the USART static driver.
4227  Remarks:
4228  Static interfaces incorporate the driver instance number within the names
4229  of the routines, eliminating the need for an object ID or object handle.
4230  Static single-open interfaces also eliminate the need for the open handle.
4231 *******************************************************************************/
4232 //DOM-IGNORE-BEGIN
4233 /*******************************************************************************
4234 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4235 Microchip licenses to you the right to use, modify, copy and distribute
4236 Software only when embedded on a Microchip microcontroller or digital signal
4237 controller that is integrated into your product or third party product
4238 (pursuant to the sublicense terms in the accompanying license agreement).
4239 You should refer to the license agreement accompanying this Software for
4240 additional information regarding your rights and obligations.
4241 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4242 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4243 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4244 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4245 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4246 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4247 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4248 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4249 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4250 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4251 *******************************************************************************/
4252 //DOM-IGNORE-END
4253 #ifndef _DRV_USART_STATIC_H
4254 #define _DRV_USART_STATIC_H
4255 // *****************************************************************************
4256 // *****************************************************************************
4257 // Section: Included Files
4258 // *****************************************************************************
4259 // *****************************************************************************
4260 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4261 /*******************************************************************************
4262  USART Driver Local Data Structures for static implementation
4263  Company:
4264  Microchip Technology Inc.
4265  File Name:
4266  drv_usart_static_local.h
4267  Summary:
4268  USART Driver Local Data Structures for static implementation
4269  Description:
4270  Driver Local Data Structures for static implementation
4271 *******************************************************************************/
4272 //DOM-IGNORE-BEGIN
4273 /*******************************************************************************
4274 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4275 Microchip licenses to you the right to use, modify, copy and distribute Software
4276 only when embedded on a Microchip microcontroller or digital signal controller
4277 that is integrated into your product or third party product (pursuant to the
4278 sublicense terms in the accompanying license agreement).
4279 You should refer to the license agreement accompanying this Software for
4280 additional information regarding your rights and obligations.
4281 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4282 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4283 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4284 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4285 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4286 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4287 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4288 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4289 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4290 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4291 *******************************************************************************/
4292 //DOM-IGNORE-END
4293 #ifndef _DRV_USART_STATIC_LOCAL_H
4294 #define _DRV_USART_STATIC_LOCAL_H
4295 // *****************************************************************************
4296 // *****************************************************************************
4297 // Section: Included Files
4298 // *****************************************************************************
4299 // *****************************************************************************
4300 #include <stdint.h>
4301 #include <stdbool.h>
4302 #include <stddef.h>
4303 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4304 /*******************************************************************************
4305  USART Driver Interface Header File
4306  Company:
4307  Microchip Technology Inc.
4308  File Name:
4309  drv_usart.h
4310  Summary:
4311  USART Driver Interface Header File
4312  Description:
4313  The USART device driver provides a simple interface to manage the USART or
4314  UART modules on Microchip microcontrollers. This file provides the
4315  interface definition for the USART driver.
4316 *******************************************************************************/
4317 //DOM-IGNORE-BEGIN
4318 /*******************************************************************************
4319 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4320 Microchip licenses to you the right to use, modify, copy and distribute
4321 Software only when embedded on a Microchip microcontroller or digital signal
4322 controller that is integrated into your product or third party product
4323 (pursuant to the sublicense terms in the accompanying license agreement).
4324 You should refer to the license agreement accompanying this Software for
4325 additional information regarding your rights and obligations.
4326 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4327 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4328 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4329 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4330 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4331 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4332 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4333 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4334 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4335 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4336 *******************************************************************************/
4337 //DOM-IGNORE-END
4338 #ifndef _DRV_USART_H
4339 #define _DRV_USART_H
4340 // *****************************************************************************
4341 // *****************************************************************************
4342 // Section: File includes
4343 // *****************************************************************************
4344 // *****************************************************************************
4345 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4346 /*******************************************************************************
4347  USART Driver Definitions Header File
4348  Company:
4349  Microchip Technology Inc.
4350  File Name:
4351  drv_usart_definitions.h
4352  Summary:
4353  USART Driver Definitions Header File
4354  Description:
4355  This file will provide enumerations and other dependencies needed by
4356  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4357 *******************************************************************************/
4358 //DOM-IGNORE-BEGIN
4359 /*******************************************************************************
4360 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4361 Microchip licenses to you the right to use, modify, copy and distribute
4362 Software only when embedded on a Microchip microcontroller or digital signal
4363 controller that is integrated into your product or third party product
4364 (pursuant to the sublicense terms in the accompanying license agreement).
4365 You should refer to the license agreement accompanying this Software for
4366 additional information regarding your rights and obligations.
4367 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4368 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4369 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4370 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4371 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4372 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4373 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4374 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4375 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4376 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4377 *******************************************************************************/
4378 //DOM-IGNORE-END
4379 #ifndef _DRV_USART_DEFINITIONS_H
4380 #define _DRV_USART_DEFINITIONS_H
4381 // *****************************************************************************
4382 // *****************************************************************************
4383 // Section: File includes
4384 // *****************************************************************************
4385 // *****************************************************************************
4386 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4387 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4388 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4389 /*******************************************************************************
4390  USART Peripheral Library Interface Header
4391  Company:
4392  Microchip Technology Inc.
4393  File Name:
4394  plib_usart.h
4395  Summary:
4396  USART Peripheral Library interface header.
4397  Description:
4398  This header file contains the function prototypes and definitions of
4399  the data types and constants that make up the interface to the USART
4400  Peripheral Library for all families of Microchip microcontrollers. The
4401  functions in this file are common to the USART module.
4402  *******************************************************************************/
4403 // DOM-IGNORE-BEGIN
4404 /*******************************************************************************
4405 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4406 Microchip licenses to you the right to use, modify, copy and distribute
4407 Software only when embedded on a Microchip microcontroller or digital signal
4408 controller that is integrated into your product or third party product
4409 (pursuant to the sublicense terms in the accompanying license agreement).
4410 You should refer to the license agreement accompanying this Software for
4411 additional information regarding your rights and obligations.
4412 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4413 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4414 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4415 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4416 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4417 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4418 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4419 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4420 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4421 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4422  *******************************************************************************/
4423 // DOM-IGNORE-END
4424 #ifndef _PLIB_USART_H
4425 #define _PLIB_USART_H
4426 // DOM-IGNORE-BEGIN
4427 // DOM-IGNORE-END
4428 // ****************************************************************************
4429 // ****************************************************************************
4430 // Section: Included Files
4431 // ****************************************************************************
4432 // ****************************************************************************
4433 /* This section lists the other files that are included in this file.
4434 */
4435 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4436 /*******************************************************************************
4437  Processor Selector File for the USART
4438  Company:
4439  Microchip Technology Incorporated
4440  File Name:
4441  processor.h
4442  Summary:
4443  Selects the appropriate header for the part family
4444  Description:
4445  This file selects the appropriate header for the part family
4446  *******************************************************************************/
4447 // DOM-IGNORE-BEGIN
4448 /*******************************************************************************
4449 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4450 Microchip licenses to you the right to use, modify, copy and distribute
4451 Software only when embedded on a Microchip microcontroller or digital signal
4452 controller that is integrated into your product or third party product
4453 (pursuant to the sublicense terms in the accompanying license agreement).
4454 You should refer to the license agreement accompanying this Software for
4455 additional information regarding your rights and obligations.
4456 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4457 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4458 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4459 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4460 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4461 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4462 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4463 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4464 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4465 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4466  *******************************************************************************/
4467 // DOM-IGNORE-END
4468 #ifndef _USART_PROCESSOR_H
4469 #define _USART_PROCESSOR_H
4470 // *****************************************************************************
4471 // *****************************************************************************
4472 // Section: Included Files
4473 // *****************************************************************************
4474 // *****************************************************************************
4475 /* This section lists the other files that are included in this file.
4476  */
4477 #include <stdint.h>
4478 #include <stdbool.h>
4479 #error "No Processor Family specified"
4480  //
4481  // _USART_PROCESSOR_H
4482 /*******************************************************************************
4483  End of File
4484  */
4485 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4486 /* CLOSE_FILE Include File */
4487 
4488 // ****************************************************************************
4489 // ****************************************************************************
4490 // Section: USART Peripheral Library Interface Functions
4491 // ****************************************************************************
4492 // ****************************************************************************
4493 //******************************************************************************
4494 /* Function:
4495  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4496  Summary:
4497  Enables the USART module to continue to operate when an overflow error
4498  condition has occurred.
4499  Description:
4500  This function enables the USART module to continue to operate when an
4501  overflow error condition has occurred.
4502  This operation is atomic.
4503  Precondition:
4504  None.
4505  Parameters:
4506  index - Identifier for the device instance to be configured
4507  Returns:
4508  None.
4509  Example:
4510  <code>
4511 #define MY_USART_INSTANCE USART_ID_1
4512  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4513  </code>
4514  Remarks:
4515  This feature may not be available on all devices. Please refer to the
4516  specific device data sheet to determine availability or use
4517  PLIB_USART_ExistsRunInOverflow in your application to determine
4518  whether this feature is available.
4519 */
4520 
4521 void
4523  USART_MODULE_ID index ) ;
4524 //******************************************************************************
4525 /* Function:
4526  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
4527  Summary:
4528  Disables the Run in overflow condition mode.
4529  Description:
4530  This function disables the USART module from accepting new data when an overflow
4531  error condition is detected.
4532  This operation is atomic.
4533  Precondition:
4534  None.
4535  Parameters:
4536  index - Identifier for the device instance to be configured
4537  Returns:
4538  None.
4539  Example:
4540  <code>
4541 #define MY_USART_INSTANCE USART_ID_1
4542  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
4543  </code>
4544  Remarks:
4545  This feature may not be available on all devices. Please refer to the
4546  specific device data sheet to determine availability or use
4547  PLIB_USART_ExistsRunInOverflow in your application to determine
4548  whether this feature is available.
4549 */
4550 
4551 void
4553  USART_MODULE_ID index ) ;
4554 //******************************************************************************
4555 /* Function:
4556  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
4557  Summary:
4558  Gets the status of the Run in Overflow condition.
4559  Description:
4560  This function indicates if the USART module has been enabled to run in
4561  an overflow condition.
4562  This operation is atomic.
4563  Precondition:
4564  None.
4565  Parameters:
4566  index - Identifier for the device instance
4567  Returns:
4568  - true - Run in overflow condition is enabled
4569  - false - Run in overflow condition is disabled
4570  Example:
4571  <code>
4572 #define MY_USART_INSTANCE USART_ID_1
4573  bool status;
4574  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
4575  </code>
4576  Remarks:
4577  This feature may not be available on all devices. Please refer to the
4578  specific device data sheet to determine availability or use
4579  PLIB_USART_ExistsRunInOverflow in your application to determine
4580  whether this feature is available.
4581 */
4582 
4583 bool
4585  USART_MODULE_ID index ) ;
4586 //******************************************************************************
4587 /* Function:
4588  void PLIB_USART_BRGClockSourceSelect
4589  (
4590  USART_MODULE_ID index,
4591  USART_BRG_CLOCK_SOURCE brgClockSource
4592  )
4593  Summary:
4594  Configures the BRG clock source of the USART module.
4595  Description:
4596  This function configures the BRG Clock source of the USART. Refer to
4597  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4598  Precondition:
4599  None.
4600  Parameters:
4601  index - Identifier for the device instance to be configured
4602  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
4603  Returns:
4604  None.
4605  Example:
4606  <code>
4607 #define MY_USART_INSTANCE USART_ID_1
4608  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
4609  </code>
4610  Remarks:
4611  This feature may not be available on all devices. Please refer to the
4612  specific device data sheet to determine availability or use
4613  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4614  whether this feature is available.
4615 */
4616 
4617 void
4619  USART_MODULE_ID index ,
4620  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
4621 //******************************************************************************
4622 /* Function:
4623  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
4624  Summary:
4625  Gets the BRG clock source of the USART module.
4626  Description:
4627  This function returns the BRG Clock source of the USART. Refer to
4628  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4629  This operation is atomic.
4630  Precondition:
4631  None.
4632  Parameters:
4633  index - Identifier for the device instance
4634  Returns:
4635  One of the possible values of USART_BRG_CLOCK_SOURCE
4636  Example:
4637  <code>
4638 #define MY_USART_INSTANCE USART_ID_1
4639  USART_BRG_CLOCK_SOURCE brgClockSource;
4640  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
4641  </code>
4642  Remarks:
4643  This feature may not be available on all devices. Please refer to the
4644  specific device data sheet to determine availability or use
4645  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4646  whether this feature is available.
4647 */
4648 
4649 USART_BRG_CLOCK_SOURCE
4651  USART_MODULE_ID index ) ;
4652 //******************************************************************************
4653 /* Function:
4654  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
4655  Summary:
4656  Returns the USART module's running status.
4657  Description:
4658  This function checks if the USART module status is busy. The following
4659  functions should not be used when the module status is busy:
4660  - PLIB_USART_LineControlModeSelect
4661  - PLIB_USART_BaudRateHighSet
4662  - PLIB_USART_BaudRateHighEnable
4663  - PLIB_USART_BaudRateHighDisable
4664  - PLIB_USART_ReceiverIdleStateLowEnable
4665  - PLIB_USART_ReceiverIdleStateLowDisable
4666  - PLIB_USART_BaudRateAutoDetectEnable
4667  - PLIB_USART_LoopbackEnable
4668  - PLIB_USART_LoopbackDisable
4669  - PLIB_USART_WakeOnStartEnable
4670  - PLIB_USART_WakeOnStartDisable
4671  - PLIB_USART_OperationModeSelect
4672  - PLIB_USART_HandshakeModeSelect
4673  - PLIB_USART_IrDAEnable
4674  - PLIB_USART_IrDADisable
4675  - PLIB_USART_StopInIdleEnable
4676  - PLIB_USART_StopInIdleDisable
4677  - PLIB_USART_RunInOverflowEnable
4678  - PLIB_USART_RunInOverflowDisable
4679  - PLIB_USART_BRGClockSourceSelect
4680  - PLIB_USART_RunInSleepModeEnable
4681  - PLIB_USART_RunInSleepModeDisable
4682  This operation is atomic.
4683  Precondition:
4684  None.
4685  Parameters:
4686  index - Identifier for the device instance
4687  Returns:
4688  - true - USART module is busy
4689  - false - USART module is idle
4690  Example:
4691  <code>
4692 #define MY_USART_INSTANCE USART_ID_1
4693  bool moduleStatus;
4694  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
4695  </code>
4696  Remarks:
4697  This feature may not be available on all devices. Please refer to the
4698  specific device data sheet to determine availability or use
4699  PLIB_USART_ExistsModuleBusyStatus in your application to determine
4700  whether this feature is available.
4701 */
4702 
4703 bool
4705  USART_MODULE_ID index ) ;
4706 //******************************************************************************
4707 /* Function:
4708  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
4709  Summary:
4710  Allows the USART module's BRG clock to run when the device enters Sleep mode.
4711  Description:
4712  This function enables the USART module's BRG clock to continue operation when
4713  the device enters the Sleep mode.
4714  This operation is atomic.
4715  Precondition:
4716  None.
4717  Parameters:
4718  index - Identifier for the device instance to be configured
4719  Returns:
4720  None.
4721  Example:
4722  <code>
4723 #define MY_USART_INSTANCE USART_ID_1
4724  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
4725  </code>
4726  Remarks:
4727  This feature may not be available on all devices. Please refer to the
4728  specific device data sheet to determine availability or use
4729  PLIB_USART_ExistsRunInSleepMode in your application to determine
4730  whether this feature is available.
4731 */
4732 
4733 void
4735  USART_MODULE_ID index ) ;
4736 //******************************************************************************
4737 /* Function:
4738  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
4739  Summary:
4740  Turns off the USART module's BRG clock during Sleep mode.
4741  Description:
4742  This function turns off the USART module's BRG clock during Sleep mode.
4743  This operation is atomic.
4744  Precondition:
4745  None.
4746  Parameters:
4747  index - Identifier for the device instance to be configured
4748  Returns:
4749  None.
4750  Example:
4751  <code>
4752 #define MY_USART_INSTANCE USART_ID_1
4753  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
4754  </code>
4755  Remarks:
4756  This feature may not be available on all devices. Please refer to the
4757  specific device data sheet to determine availability or use
4758  PLIB_USART_ExistsRunInSleepMode in your application to determine
4759  whether this feature is available.
4760 */
4761 
4762 void
4764  USART_MODULE_ID index ) ;
4765 //******************************************************************************
4766 /* Function:
4767  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
4768  Summary:
4769  Gets the status of Run in Sleep mode.
4770  Description:
4771  This function indicates if the USART module has been enabled to run in
4772  Sleep mode.
4773  This operation is atomic.
4774  Precondition:
4775  None.
4776  Parameters:
4777  index - Identifier for the device instance
4778  Returns:
4779  - true - Run in Sleep mode is enabled
4780  - false - Run in Sleep mode is disabled
4781  Example:
4782  <code>
4783 #define MY_USART_INSTANCE USART_ID_1
4784  bool status;
4785  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
4786  </code>
4787  Remarks:
4788  This feature may not be available on all devices. Please refer to the
4789  specific device data sheet to determine availability or use
4790  PLIB_USART_ExistsRunInSleepMode in your application to determine
4791  whether this feature is available.
4792 */
4793 
4794 bool
4796  USART_MODULE_ID index ) ;
4797 //******************************************************************************
4798 /* Function:
4799  void PLIB_USART_Enable ( USART_MODULE_ID index )
4800  Summary:
4801  Enables the specific USART module.
4802  Description:
4803  This function enables the specific USART module.
4804  This operation is atomic.
4805  Precondition:
4806  None.
4807  Parameters:
4808  index - Identifier for the device instance to be configured
4809  Returns:
4810  None.
4811  Example:
4812  <code>
4813 #define MY_USART_INSTANCE USART_ID_1
4814  PLIB_USART_Enable(MY_USART_INSTANCE);
4815  </code>
4816  Remarks:
4817  By calling this function, the USART pins are controlled by the USART
4818  module.
4819  This feature may not be available on all devices. Please refer to the
4820  specific device data sheet to determine availability or use
4821  PLIB_USART_ExistsEnable in your application to determine whether
4822  this feature is available.
4823 */
4824 
4825 void
4827  USART_MODULE_ID index ) ;
4828 //******************************************************************************
4829 /* Function:
4830  void PLIB_USART_Disable ( USART_MODULE_ID index )
4831  Summary:
4832  Disables the specific USART module
4833  Description:
4834  This function disables the specific USART module.
4835  This operation is atomic.
4836  Precondition:
4837  None.
4838  Parameters:
4839  index - Identifier for the device instance to be configured
4840  Returns:
4841  None.
4842  Example:
4843  <code>
4844 #define MY_USART_INSTANCE USART_ID_1
4845  PLIB_USART_Disable(MY_USART_INSTANCE);
4846  </code>
4847  Remarks:
4848  The default state after any reset for a USART module is the disable state.
4849  If the USART is disabled, all of the related pins are in control of the
4850  general purpose I/O logic.
4851 
4852  Disabling the USART module resets the buffers to empty states. Any data
4853  characters in the buffers are lost and the baud rate is reset. All error
4854  and status bits are also reset.
4855 
4856  Disabling the USART while the USART is active, will abort all pending
4857  transmissions and receptions. Re-enabling the USART will restart the
4858  module in the same configuration.
4859 
4860  When disabled, the USART power consumption is minimal.
4861  This feature may not be available on all devices. Please refer to the
4862  specific device data sheet to determine availability or use
4863  PLIB_USART_ExistsEnable in your application to determine whether
4864  this feature is available.
4865 */
4866 
4867 void
4869  USART_MODULE_ID index ) ;
4870 //******************************************************************************
4871 /* Function:
4872  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
4873  Summary:
4874  Enables the specific USART module transmitter.
4875  Description:
4876  This function enables the specific USART module transmitter.
4877  This operation is atomic.
4878  Precondition:
4879  The USART module should be enabled using the function PLIB_USART_Enable
4880  before this function is called.
4881  Parameters:
4882  index - Identifier for the device instance to be configured
4883  Returns:
4884  None.
4885  Example:
4886  <code>
4887 #define MY_USART_INSTANCE USART_ID_1
4888  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
4889  </code>
4890  Remarks:
4891  The transmitter should not be enabled until the USART is enabled.
4892  The transmissions will not be enabled otherwise.
4893 
4894  This feature may not be available on all devices. Please refer to the
4895  specific device data sheet to determine availability or use
4896  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4897  this feature is available.
4898 */
4899 
4900 void
4902  USART_MODULE_ID index ) ;
4903 //******************************************************************************
4904 /* Function:
4905  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
4906  Summary:
4907  Disables the specific USART module transmitter.
4908  Description:
4909  This function disables the specific USART module transmitter.
4910  This operation is atomic.
4911  Precondition:
4912  None.
4913  Parameters:
4914  index - Identifier for the device instance to be configured
4915  Returns:
4916  None.
4917  Example:
4918  <code>
4919 #define MY_USART_INSTANCE USART_ID_1
4920  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
4921  </code>
4922  Remarks:
4923  Disabling the transmitter during a transmission will cause the
4924  transmission to be aborted.
4925 
4926  This feature may not be available on all devices. Please refer to the
4927  specific device data sheet to determine availability or use
4928  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4929  this feature is available.
4930 */
4931 
4932 void
4934  USART_MODULE_ID index ) ;
4935 //******************************************************************************
4936 /* Function:
4937  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
4938  uint32_t baudRate );
4939  Summary:
4940  Sets the baud rate to the desired value.
4941  Description:
4942  This function sets the baud rate to the desired value.
4943  Precondition:
4944  None.
4945  Parameters:
4946  index - Identifier for the device instance to be configured
4947  baudRate - Baud Rate Value
4948  clockFrequency - Clock Frequency
4949  Returns:
4950  None.
4951  Example:
4952  <code>
4953 #define MY_USART_INSTANCE USART_ID_1
4954  uint32_t baudRateValue ;
4955  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
4956  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
4957  </code>
4958  Remarks:
4959  Setting a new baud rate value causes the baud rate timer to reset.
4960  This ensures that the baud rate timer does not have to overflow before
4961  outputting the new baud rate.
4962 
4963  If the system clock is changed during an active receive operation, a
4964  receiver error or data loss may result. To avoid this issue verify that
4965  no receptions are in progress before changing the system clock.
4966 
4967  This feature may not be available on all devices. Please refer to the
4968  specific device data sheet to determine availability or use
4969  PLIB_USART_ExistsBaudRate in your application to determine whether
4970  this feature is available.
4971 */
4972 
4973 void
4975  USART_MODULE_ID index ,
4976  uint32_t clockFrequency ,
4977  uint32_t baudRate ) ;
4978 //******************************************************************************
4979 /* Function:
4980  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
4981  uint32_t clockFrequency, uint32_t baudRate );
4982  Summary:
4983  Sets the baud rate to the desired value.
4984  Description:
4985  This function sets the baud rate to the desired value.
4986  Precondition:
4987  None.
4988  Parameters:
4989  index - Identifier for the device instance to be configured
4990  baudRate - Baud Rate Value, it is the baud rate value
4991  clockFrequency - Clock Frequency
4992  Returns:
4993  None.
4994  Example:
4995  <code>
4996 #define MY_USART_INSTANCE USART_ID_1
4997  uint32_t baudRateValue ;
4998  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
4999  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5000  </code>
5001  Remarks:
5002  Setting a new baud rate value causes the baud rate timer to reset.
5003  This ensures that the baud rate timer does not have to overflow before
5004  outputting the new baud rate.
5005 
5006  If the system clock is changed during an active receive operation, a
5007  receiver error or data loss may result. To avoid this issue verify that
5008  no receptions are in progress before changing the system clock.
5009 
5010  This feature may not be available on all devices. Please refer to the
5011  specific device data sheet to determine availability or use
5012  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5013  this feature is available.
5014 */
5015 
5016 void
5018  USART_MODULE_ID index ,
5019  uint32_t clockFrequency ,
5020  uint32_t baudRate ) ;
5021 //******************************************************************************
5022 /* Function:
5023  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5024  int32_t clockFrequency );
5025  Summary:
5026  Gets the baud rate current in use.
5027  Description:
5028  This function gets the baud rate that is currently in use. The clock frequency
5029  needs to be passed to the function.
5030  Conditions:
5031  None.
5032  Input:
5033  index - Identifier for the device instance to be configured
5034  clockFrequency - Clock Frequency
5035  Returns:
5036  - BaudRate - Baud rate value
5037  Example:
5038  <code>
5039 #define MY_USART_INSTANCE USART_ID_1
5040  uint32_t baudRate ;
5041  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5042  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5043  </code>
5044  Remarks:
5045  This feature may not be available on all devices. Please refer to the
5046  specific device data sheet to determine availability or use
5047  PLIB_USART_ExistsBaudRate in your application to determine whether
5048  this feature is available.
5049 */
5050 
5051 uint32_t
5053  USART_MODULE_ID index ,
5054  int32_t clockFrequency ) ;
5055 //******************************************************************************
5056 /* Function:
5057  void PLIB_USART_AddressSet
5058  (
5059  USART_MODULE_ID index,
5060  uint8_t address
5061  )
5062  Summary:
5063  Sets the address for the Address Detect mode.
5064  Description:
5065  This function sets the address for the Address Detect mode.
5066  This operation is atomic.
5067  Precondition:
5068  None.
5069  Parameters:
5070  index - Identifier for the device instance to be configured
5071  address - Address
5072  Returns:
5073  None.
5074  Example:
5075  <code>
5076 #define MY_USART_INSTANCE USART_ID_1
5077  uint8_t address = 0x02;
5078  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5079  </code>
5080  Remarks:
5081  This feature may not be available on all devices. Please refer to the
5082  specific device data sheet to determine availability or use
5083  PLIB_USART_ExistsReceiverAddress in your application to determine
5084  whether this feature is available.
5085 */
5086 
5087 void
5089  USART_MODULE_ID index ,
5090  uint8_t address ) ;
5091 //******************************************************************************
5092 /* Function:
5093  uint8_t PLIB_USART_AddressGet
5094  (
5095  USART_MODULE_ID index
5096  )
5097  Summary:
5098  Gets the address for the Address Detect mode.
5099  Description:
5100  This function returns the address value being used for the Address
5101  Detect mode.
5102  This operation is atomic.
5103  Precondition:
5104  None.
5105  Parameters:
5106  index - Identifier for the device instance
5107  Returns:
5108  - address - The address being used
5109  Example:
5110  <code>
5111 #define MY_USART_INSTANCE USART_ID_1
5112  uint8_t address = 0;
5113  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5114  </code>
5115  Remarks:
5116  This feature may not be available on all devices. Please refer to the
5117  specific device data sheet to determine availability or use
5118  PLIB_USART_ExistsReceiverAddress in your application to determine
5119  whether this feature is available.
5120 */
5121 
5122 uint8_t
5124  USART_MODULE_ID index ) ;
5125 //******************************************************************************
5126 /* Function:
5127  void PLIB_USART_AddressMaskSet
5128  (
5129  USART_MODULE_ID index,
5130  uint8_t mask
5131  )
5132  Summary:
5133  Sets the address mask for the Address Detect mode.
5134  Description:
5135  This function sets the address mask for the Address Detect mode.
5136  This operation is atomic.
5137  Precondition:
5138  None.
5139  Parameters:
5140  index - Identifier for the device instance to be configured
5141  mask - Address match mask bits
5142  Returns:
5143  None.
5144  Example:
5145  <code>
5146 #define MY_USART_INSTANCE USART_ID_1
5147  uint8_t mask = 0x0F;
5148  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5149  </code>
5150  Remarks:
5151  This feature may not be available on all devices. Please refer to the
5152  specific device data sheet to determine availability or use
5153  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5154  whether this feature is available.
5155 */
5156 
5157 void
5159  USART_MODULE_ID index ,
5160  uint8_t mask ) ;
5161 //******************************************************************************
5162 /* Function:
5163  uint8_t PLIB_USART_AddressMaskGet
5164  (
5165  USART_MODULE_ID index
5166  )
5167  Summary:
5168  Gets the address mask for the Address Detect mode.
5169  Description:
5170  This function returns the address mask value being used for the Address
5171  Detect mode.
5172  This operation is atomic.
5173  Precondition:
5174  None.
5175  Parameters:
5176  index - Identifier for the device instance to be configured
5177  Returns:
5178  - mask - Address mask being used
5179  Example:
5180  <code>
5181 #define MY_USART_INSTANCE USART_ID_1
5182  uint8_t mask = 0;
5183  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5184  </code>
5185  Remarks:
5186  This feature may not be available on all devices. Please refer to the
5187  specific device data sheet to determine availability or use
5188  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5189  whether this feature is available.
5190 */
5191 
5192 uint8_t
5194  USART_MODULE_ID index ) ;
5195 //******************************************************************************
5196 /* Function:
5197  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5198  Summary:
5199  Enables the Address Detect mode.
5200  Description:
5201  This function enables the Address Detect mode. If it is enabled, and the
5202  device is addressed, disable the Address Detect mode to continue receiving
5203  bytes.
5204  This operation is atomic.
5205  Precondition:
5206  None.
5207  Parameters:
5208  index - Identifier for the device instance to be configured
5209  Returns:
5210  None.
5211  Example:
5212  <code>
5213 #define MY_USART_INSTANCE USART_ID_1
5214  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5215  </code>
5216  Remarks:
5217  If 9 data bits are not selected, this bit has no effect.
5218  This feature may not be available on all devices. Please refer to the
5219  specific device data sheet to determine availability or use
5220  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5221  this feature is available.
5222 */
5223 
5224 void
5226  USART_MODULE_ID index ) ;
5227 //******************************************************************************
5228 /* Function:
5229  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5230  Summary:
5231  Enables the Address Detect mode.
5232  Description:
5233  This function disables the Address Detect mode. If it is enabled, and the
5234  device is addressed, disable the Address Detect mode to continue receiving
5235  bytes.
5236  This operation is atomic.
5237  Precondition:
5238  None.
5239  Parameters:
5240  index - Identifier for the device instance to be configured
5241  Returns:
5242  None.
5243  Example:
5244  <code>
5245 #define MY_USART_INSTANCE USART_ID_1
5246  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5247  </code>
5248  Remarks:
5249  All bytes are received, and the 9th bit can be used as the parity bit.
5250  By default, the address detect is disabled.
5251 
5252  This feature may not be available on all devices. Please refer to the
5253  specific device data sheet to determine availability or use
5254  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5255  this feature is available.
5256 */
5257 
5258 void
5260  USART_MODULE_ID index ) ;
5261 //******************************************************************************
5262 /* Function:
5263  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5264  Summary:
5265  Gets the state of the automatic baud detection.
5266  Description:
5267  This function gets the state of the automatic baud detection and returns a '0'
5268  if the baud rate auto detection is complete.
5269  This operation is atomic.
5270  Precondition:
5271  None.
5272  Parameters:
5273  index - Identifier for the device instance to be configured
5274  Returns:
5275  - true - Baud rate detection is not complete
5276  - false - Baud rate detection is complete
5277  Example:
5278  <code>
5279 #define MY_USART_INSTANCE USART_ID_1
5280  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5281  // Wait until the baud rate is detected.
5282  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5283  </code>
5284  Remarks:
5285  This feature may not be available on all devices. Please refer to the
5286  specific device data sheet to determine availability or use
5287  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5288  this feature is available.
5289 */
5290 
5291 bool
5293  USART_MODULE_ID index ) ;
5294 //******************************************************************************
5295 /* Function:
5296  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5297  Summary:
5298  Enables baud rate measurement on the next character, which requires reception
5299  of the Sync character.
5300  Description:
5301  This function enables the baud rate measurement on the next character,
5302  which requires reception of the Sync character.
5303  This operation is atomic.
5304  Precondition:
5305  None.
5306  Parameters:
5307  index - Identifier for the device instance to be configured
5308  Returns:
5309  None.
5310  Example:
5311  <code>
5312 #define MY_USART_INSTANCE USART_ID_1
5313  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5314  // Wait until the baud rate is detected.
5315  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5316  </code>
5317  Remarks:
5318  This feature may not be available on all devices. Please refer to the
5319  specific device data sheet to determine availability or use
5320  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5321  this feature is available.
5322 */
5323 
5324 void
5326  USART_MODULE_ID index ) ;
5327 //******************************************************************************
5328 /* Function:
5329  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5330  Summary:
5331  Data to be transmitted in the Byte mode.
5332  Description:
5333  The data is transmitted in the Byte mode for the specified USART module.
5334  This operation is atomic.
5335  Precondition:
5336  None.
5337  Parameters:
5338  index - Identifier for the device instance to be configured
5339  data - Data to be transmitted.
5340  Returns:
5341  None.
5342  Example:
5343  <code>
5344 #define MY_USART_INSTANCE USART_ID_1
5345  uint8_t data = 'a';
5346  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5347  {
5348  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5349  }
5350  </code>
5351  Remarks:
5352  This feature may not be available on all devices. Please refer to the
5353  specific device data sheet to determine availability or use
5354  PLIB_USART_ExistsTransmitter in your application to determine whether
5355  this feature is available.
5356 */
5357 
5358 void
5360  USART_MODULE_ID index ,
5361  int8_t data ) ;
5362 //******************************************************************************
5363 /* Function:
5364  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5365  Summary:
5366  Data to be received in the Byte mode.
5367  Description:
5368  The data to be received in Byte mode from the specified USART module.
5369  This operation is atomic.
5370  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5371  PLIB_USART_ReceiverParityErrorHasOccurred and
5372  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5373  Precondition:
5374  None.
5375  Parameters:
5376  index - Identifier for the device instance to be configured
5377  Returns:
5378  - data - Data to be received
5379  Example:
5380  <code>
5381 #define MY_USART_INSTANCE USART_ID_1
5382  bool isError;
5383  uint8_t mydata;
5384  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5385  {
5386  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5387  }
5388  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5389  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5390  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5391  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5392  {
5393  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5394  }
5395  </code>
5396  Remarks:
5397  This feature may not be available on all devices. Please refer to the
5398  specific device data sheet to determine availability or use
5399  PLIB_USART_ExistsReceiver in your application to determine whether
5400  this feature is available.
5401 */
5402 
5403 int8_t
5405  USART_MODULE_ID index ) ;
5406 //******************************************************************************
5407 /* Function:
5408  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5409  Summary:
5410  Data to be received in the byte mode with the 9th bit.
5411  Description:
5412  The data to be received in Byte mode from the specified USART module.
5413  with the 9th bit.
5414  This operation is atomic.
5415  Precondition:
5416  None.
5417  Parameters:
5418  index - Identifier for the device instance to be configured
5419  Returns:
5420  - data - Data to be received
5421  Example:
5422  <code>
5423 #define MY_USART_INSTANCE USART_ID_1
5424  uint16_t mydata;
5425  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5426  {
5427  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5428  }
5429  </code>
5430  Remarks:
5431  This feature may not be available on all devices. Please refer to the
5432  specific device data sheet to determine availability or use
5433  PLIB_USART_ExistsReceiver9Bits in your application to determine
5434  whether this feature is available.
5435 */
5436 
5437 int16_t
5439  USART_MODULE_ID index ) ;
5440 //******************************************************************************
5441 /* Function:
5442  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5443  Summary:
5444  Checks and return if the data received is an address.
5445  Description:
5446  Checks and return if the data received is an address. The address has
5447  the 9th bit set. If data received has the 9th bit set, the function returns true;
5448  otherwise, the function returns false.
5449  This operation is atomic.
5450  Precondition:
5451  The USART module should be configured to use the 9 data bits.
5452  Parameters:
5453  index - Identifier for the device instance to be configured
5454  Returns:
5455  - true - if the data received has the 9th bit set
5456  - false - if the address received has the 9th bit cleared
5457  Example:
5458  <code>
5459 #define MY_USART_INSTANCE USART_ID_1
5460  int8_t address;
5461  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5462  {
5463  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5464  }
5465  </code>
5466  Remarks:
5467  This feature may not be available on all devices. Please refer to the
5468  specific device data sheet to determine availability or use
5469  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5470  this feature is available.
5471 */
5472 
5473 bool
5475  USART_MODULE_ID index ) ;
5476 //******************************************************************************
5477 /* Function:
5478  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5479  int8_t data, bool 9thBit )
5480  Summary:
5481  Data to be transmitted in the byte mode with the 9th bit.
5482  Description:
5483  The data is transmitted in the byte mode for the specified USART module,
5484  with 9th bit.
5485  This operation is atomic.
5486  Precondition:
5487  The USART module should be configured to use the 9 data bits.
5488  Parameters:
5489  index - Identifier for the device instance to be configured
5490  data - Data to be transmitted.
5491  9thBit - 9th bit of the data to be transmitted.
5492  Returns:
5493  None.
5494  Example:
5495  <code>
5496 #define MY_USART_INSTANCE USART_ID_1
5497  uint8_t data = 'a';
5498  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5499  {
5500  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5501  }
5502  </code>
5503  Remarks:
5504  This feature may not be available on all devices. Please refer to the
5505  specific device data sheet to determine availability or use
5506  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5507  this feature is available.
5508 */
5509 
5510 void
5512  USART_MODULE_ID index ,
5513  int8_t data ,
5514  bool Bit9th ) ;
5515 //******************************************************************************
5516 /* Function:
5517  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5518  Summary:
5519  Transmits the break character.
5520  Description:
5521  This function transmits the break character.
5522  This operation is atomic.
5523  Precondition:
5524  The application should wait for the transmitter to be idle, before calling
5525  this function.
5526  Parameters:
5527  index - Identifier for the device instance to be configured
5528  Returns:
5529  None.
5530  Example:
5531  <code>
5532 #define MY_USART_INSTANCE USART_ID_1
5533  // Wait for the Transmit buffer to be empty.
5534  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5535  // Transmit the break character.
5536  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5537  // wait for the break transmission to complete
5538  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5539  </code>
5540  Remarks:
5541  After the break has been transmitted, the application can start
5542  transmitting next bytes.
5543 
5544  This feature may not be available on all devices. Please refer to the
5545  specific device data sheet to determine availability or use
5546  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5547  this feature is available.
5548 */
5549 
5550 void
5552  USART_MODULE_ID index ) ;
5553 //******************************************************************************
5554 /* Function:
5555  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
5556  Summary:
5557  Returns the status of the break transmission
5558  Description:
5559  The function returns the status of the break transmission.
5560  This operation is atomic.
5561  Precondition:
5562  None.
5563  Parameters:
5564  index - Identifier for the device instance to be configured
5565  Returns:
5566  - true - Transmit break on the next transmission
5567  - false - Break transmission completed or not started
5568  Example:
5569  <code>
5570 #define MY_USART_INSTANCE USART_ID_1
5571  // Wait for the Transmit buffer to be empty.
5572  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5573  // Transmit the break character.
5574  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5575  // wait for the break transmission to complete
5576  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5577  </code>
5578  Remarks:
5579  After the break has been transmitted, the application can start
5580  transmitting next bytes.
5581 
5582  This feature may not be available on all devices. Please refer to the
5583  specific device data sheet to determine availability or use
5584  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5585  this feature is available.
5586 */
5587 
5588 bool
5590  USART_MODULE_ID index ) ;
5591 //******************************************************************************
5592 /* Function:
5593  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
5594  Summary:
5595  Identifies if the receive data is available for the specified USART module.
5596  Description:
5597  This function identifies if the receive data is available for the specified
5598  USART module.
5599  This operation is atomic.
5600  Precondition:
5601  None.
5602  Parameters:
5603  index - Identifier for the device instance to be configured
5604  Returns:
5605  - true - The data is available
5606  - false - The data is not available
5607  Example:
5608  <code>
5609 #define MY_USART_INSTANCE USART_ID_1
5610  int8_t mydata;
5611  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5612  {
5613  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5614  }
5615  </code>
5616  Remarks:
5617  This feature may not be available on all devices. Please refer to the
5618  specific device data sheet to determine availability or use
5619  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
5620  whether this feature is available.
5621 */
5622 
5623 bool
5625  USART_MODULE_ID index ) ;
5626 //******************************************************************************
5627 /* Function:
5628  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
5629  Summary:
5630  Clears a USART vverrun error.
5631  Description:
5632  This function clears an overrun error. Clearing the error, resets the receive buffer.
5633  This operation is atomic.
5634  Precondition:
5635  None.
5636  Parameters:
5637  index - Identifier for the device instance to be configured
5638  Returns:
5639  None.
5640  Example:
5641  <code>
5642 #define MY_USART_INSTANCE USART_ID_1
5643  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5644  {
5645  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5646  }
5647  </code>
5648  Remarks:
5649  WARNING: Calling this API will clear all of the previously received data.
5650 
5651  This feature may not be available on all devices. Please refer to the
5652  specific device data sheet to determine availability or use
5653  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5654  whether this feature is available.
5655 */
5656 
5657 void
5659  USART_MODULE_ID index ) ;
5660 //******************************************************************************
5661 /* Function:
5662  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
5663  Summary:
5664  Gets the transmit buffer full status.
5665  Description:
5666  This function gets the transmit status of the specified USART module.
5667  This operation is atomic.
5668  Precondition:
5669  None.
5670  Parameters:
5671  index - Identifier for the device instance to be configured
5672  Returns:
5673  - true - The transmit buffer is full
5674  - false - The transmit buffer is not full, at least one more
5675  character can be written
5676  Example:
5677  <code>
5678 #define MY_USART_INSTANCE USART_ID_1
5679  // Wait for the Transmit buffer to be empty.
5680  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5681  // Transmit the break character.
5682  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5683  </code>
5684  Remarks:
5685  This feature may not be available on all devices. Please refer to the
5686  specific device data sheet to determine availability or use
5687  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
5688  whether this feature is available.
5689 */
5690 
5691 bool
5693  USART_MODULE_ID index ) ;
5694 //******************************************************************************
5695 /* Function:
5696  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
5697  Summary:
5698  Gets the transmit shift register empty status.
5699  Description:
5700  This function gets the transmit shift register empty status.
5701  This operation is atomic.
5702  Precondition:
5703  None.
5704  Parameters:
5705  index - Identifier for the device instance to be configured
5706  Returns:
5707  - true - The transmit shift register is empty
5708  - false - The transmit shift register is not empty
5709  Example:
5710  <code>
5711 #define MY_USART_INSTANCE USART_ID_1
5712  // Wait for the Transmit buffer to be empty.
5713  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
5714  // Transmit the break character.
5715  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5716  </code>
5717  Remarks:
5718  This feature may not be available on all devices. Please refer to the
5719  specific device data sheet to determine availability or use
5720  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
5721  whether this feature is available.
5722 */
5723 
5724 bool
5726  USART_MODULE_ID index ) ;
5727 //******************************************************************************
5728 /* Function:
5729  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
5730  Summary:
5731  Gets the framing error status.
5732  Description:
5733  This function gets the framing error status.
5734  This operation is atomic.
5735  Precondition:
5736  None.
5737  Parameters:
5738  index - Identifier for the device instance to be configured
5739  Returns:
5740  - true - The framing error was detected on the current character
5741  - false - The framing error was not detected on the current
5742  character
5743  Example:
5744  <code>
5745 #define MY_USART_INSTANCE USART_ID_1
5746  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
5747  </code>
5748  Remarks:
5749  Reading the error clears the error.
5750  This feature may not be available on all devices. Please refer to the
5751  specific device data sheet to determine availability or use
5752  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
5753  whether this feature is available.
5754 */
5755 
5756 bool
5758  USART_MODULE_ID index ) ;
5759 //******************************************************************************
5760 /* Function:
5761  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
5762  Summary:
5763  Gets the parity error status.
5764  Description:
5765  This function gets the parity error status.
5766  This operation is atomic.
5767  Precondition:
5768  None.
5769  Parameters:
5770  index - Identifier for the device instance to be configured
5771  Returns:
5772  - true - The parity error was detected on the current character
5773  - false - The parity error was not detected on the current character
5774  Example:
5775  <code>
5776 #define MY_USART_INSTANCE USART_ID_1
5777  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
5778  </code>
5779  Remarks:
5780  Reading the error clears the error.
5781  A Parity error is irrelevant in case of 9-bit mode.
5782  This feature may not be available on all devices. Please refer to the
5783  specific device data sheet to determine availability or use
5784  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
5785  whether this feature is available.
5786 */
5787 
5788 bool
5790  USART_MODULE_ID index ) ;
5791 //******************************************************************************
5792 /* Function:
5793  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
5794  Summary:
5795  Identifies if there was a receiver overrun error.
5796  Description:
5797  This function identifies if there was a receiver overrun error.
5798  This operation is atomic.
5799  Precondition:
5800  None.
5801  Parameters:
5802  index - Identifier for the device instance to be configured
5803  Returns:
5804  - true - The receive buffer has overflowed
5805  - false - The receive buffer has not overflowed
5806  Example:
5807  <code>
5808 #define MY_USART_INSTANCE USART_ID_1
5809  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5810  {
5811  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5812  }
5813  </code>
5814  Remarks:
5815  This feature may not be available on all devices. Please refer to the
5816  specific device data sheet to determine availability or use
5817  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5818  whether this feature is available.
5819 */
5820 
5821 bool
5823  USART_MODULE_ID index ) ;
5824 //******************************************************************************
5825 /* Function:
5826  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
5827  Summary:
5828  Identifies if the receiver is idle.
5829  Description:
5830  This function identifies if the receiver is idle.
5831  This operation is atomic.
5832  Precondition:
5833  None.
5834  Parameters:
5835  index - Identifier for the device instance to be configured
5836  Returns:
5837  - true - The receive buffer is idle
5838  - false - The receive buffer is not idle
5839  Example:
5840  <code>
5841 #define MY_USART_INSTANCE USART_ID_1
5842  int8_t mydata;
5843  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
5844  {
5845  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5846  }
5847  </code>
5848  Remarks:
5849  This feature may not be available on all devices. Please refer to the
5850  specific device data sheet to determine availability or use
5851  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
5852  whether this feature is available.
5853 */
5854 
5855 bool
5857  USART_MODULE_ID index ) ;
5858 //******************************************************************************
5859 /* Function:
5860  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
5861  Summary:
5862  Enables the USART receiver.
5863  Description:
5864  This function enables the USART receiver.
5865  This operation is atomic.
5866  Precondition:
5867  None.
5868  Parameters:
5869  index - Identifier for the device instance to be configured
5870  Returns:
5871  None.
5872  Example:
5873  <code>
5874 #define MY_USART_INSTANCE USART_ID_1
5875  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
5876  </code>
5877  Remarks:
5878  This feature may not be available on all devices. Please refer to the
5879  specific device data sheet to determine availability or use
5880  PLIB_USART_ExistsReceiverEnable in your application to determine
5881  whether this feature is available.
5882 */
5883 
5884 void
5886  USART_MODULE_ID index ) ;
5887 //******************************************************************************
5888 /* Function:
5889  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
5890  Summary:
5891  Disables the USART receiver.
5892  Description:
5893  This function disables the USART receiver.
5894  This operation is atomic.
5895  Precondition:
5896  None.
5897  Parameters:
5898  index - Identifier for the device instance to be configured
5899  Returns:
5900  None.
5901  Example:
5902  <code>
5903 #define MY_USART_INSTANCE USART_ID_1
5904  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
5905  </code>
5906  Remarks:
5907  This feature may not be available on all devices. Please refer to the
5908  specific device data sheet to determine availability or use
5909  PLIB_USART_ExistsReceiverEnable in your application to determine
5910  whether this feature is available.
5911 */
5912 
5913 void
5915  USART_MODULE_ID index ) ;
5916 //******************************************************************************
5917 /* Function:
5918  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
5919  Summary:
5920  Enables the Transmit Idle Low state.
5921  Description:
5922  This function enables the Transmit Idle Low state. In the USART Synchronous
5923  mode, this function configures that the TX polarity, the idle state is low.
5924  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
5925  state to a '1'.
5926  This operation is atomic.
5927  Precondition:
5928  None.
5929  Parameters:
5930  index - Identifier for the device instance to be configured
5931  Returns:
5932  None.
5933  Example:
5934  <code>
5935 #define MY_USART_INSTANCE USART_ID_1
5936  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
5937  </code>
5938  Remarks:
5939  This feature may not be available on all devices. Please refer to the
5940  specific device data sheet to determine availability or use
5941  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5942  whether this feature is available.
5943 */
5944 
5945 void
5947  USART_MODULE_ID index ) ;
5948 //******************************************************************************
5949 /* Function:
5950  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
5951  Summary:
5952  Disables the Transmit Idle Low state.
5953  Description:
5954  This function disables the Transmit Idle Low state. In USART Synchronous mode,
5955  this function configures that the TX polarity the idle state is high.
5956  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
5957  state to a '0'.
5958  This operation is atomic.
5959  Precondition:
5960  None.
5961  Parameters:
5962  index - Identifier for the device instance to be configured
5963  Returns:
5964  None.
5965  Example:
5966  <code>
5967 #define MY_USART_INSTANCE USART_ID_1
5968  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
5969  </code>
5970  Remarks:
5971  This feature may not be available on all devices. Please refer to the
5972  specific device data sheet to determine availability or use
5973  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5974  whether this feature is available.
5975 */
5976 
5977 void
5979  USART_MODULE_ID index ) ;
5980 //******************************************************************************
5981 /* Function:
5982  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
5983  Summary:
5984  Enables receive polarity inversion.
5985  Description:
5986  This function enables receive polarity inversion. In the USART Synchronous mode,
5987  this function configures that the data is inverted.
5988  This operation is atomic.
5989  Precondition:
5990  None.
5991  Parameters:
5992  index - Identifier for the device instance to be configured
5993  Returns:
5994  None.
5995  Example:
5996  <code>
5997 #define MY_USART_INSTANCE USART_ID_1
5998  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
5999  </code>
6000  Remarks:
6001  This feature may not be available on all devices. Please refer to the
6002  specific device data sheet to determine availability or use
6003  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6004  whether this feature is available.
6005 */
6006 
6007 void
6009  USART_MODULE_ID index ) ;
6010 //******************************************************************************
6011 /* Function:
6012  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6013  Summary:
6014  Disables receive polarity inversion.
6015  This operation is atomic.
6016  Description:
6017  This function disables receive polarity inversion. In the USART Synchronous
6018  mode, this function configures that the data is not inverted.
6019  Precondition:
6020  None.
6021  Parameters:
6022  index - Identifier for the device instance to be configured
6023  Returns:
6024  None.
6025  Example:
6026  <code>
6027 #define MY_USART_INSTANCE USART_ID_1
6028  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6029  </code>
6030  Remarks:
6031  This feature may not be available on all devices. Please refer to the
6032  specific device data sheet to determine availability or use
6033  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6034  whether this feature is available.
6035 */
6036 
6037 void
6039  USART_MODULE_ID index ) ;
6040 //******************************************************************************
6041 /* Function:
6042  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6043  Summary:
6044  Enables high baud rate selection.
6045  Description:
6046  This function enables high baud rate selection.
6047  This operation is atomic.
6048  Precondition:
6049  None.
6050  Parameters:
6051  index - Identifier for the device instance to be configured
6052  Returns:
6053  None.
6054  Example:
6055  <code>
6056 #define MY_USART_INSTANCE USART_ID_1
6057  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6058  </code>
6059  Remarks:
6060  This feature may not be available on all devices. Please refer to the
6061  specific device data sheet to determine availability or use
6062  PLIB_USART_ExistsBaudRateHigh in your application to determine
6063  whether this feature is available.
6064 */
6065 
6066 void
6068  USART_MODULE_ID index ) ;
6069 //******************************************************************************
6070 /* Function:
6071  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6072  Summary:
6073  Disables the high baud rate selection.
6074  Description:
6075  This function disables the high baud rate selection.
6076  This operation is atomic.
6077  Precondition:
6078  None.
6079  Parameters:
6080  index - Identifier for the device instance to be configured
6081  Returns:
6082  None.
6083  Example:
6084  <code>
6085 #define MY_USART_INSTANCE USART_ID_1
6086  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6087  </code>
6088  Remarks:
6089  This feature may not be available on all devices. Please refer to the
6090  specific device data sheet to determine availability or use
6091  PLIB_USART_ExistsBaudRateHigh in your application to determine
6092  whether this feature is available.
6093 */
6094 
6095 void
6097  USART_MODULE_ID index ) ;
6098 //******************************************************************************
6099 /* Function:
6100  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6101  USART_TRANSMIT_INTR_MODE interruptMode )
6102  Summary:
6103  Sets the USART transmitter interrupt mode.
6104  Description:
6105  This function sets the condition in which the USART module should generate
6106  an interrupt.
6107  This operation is atomic.
6108  Precondition:
6109  None.
6110  Parameters:
6111  index - Identifier for the device instance to be configured
6112  interruptMode - Interrupt mode; for possible configurations, refer to
6113  USART_TRANSMIT_INTR_MODE
6114  Returns:
6115  None.
6116  Example:
6117  <code>
6118 #define MY_USART_INSTANCE USART_ID_1
6119  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6120  USART_TRANSMIT_FIFO_EMPTY );
6121  </code>
6122  Remarks:
6123  This feature may not be available on all devices. Please refer to the
6124  specific device data sheet to determine availability or use
6125  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6126  whether this feature is available.
6127 */
6128 
6129 void
6131  USART_MODULE_ID index ,
6132  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6133 //******************************************************************************
6134 /* Function:
6135  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6136  USART_RECEIVE_INTR_MODE interruptMode )
6137  Summary:
6138  Sets the USART receiver FIFO level.
6139  Description:
6140  This function sets the USART receiver FIFO level.
6141  This operation is atomic.
6142  Precondition:
6143  None.
6144  Parameters:
6145  index - Identifier for the device instance to be configured
6146  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6147  Returns:
6148  None.
6149  Example:
6150  <code>
6151 #define MY_USART_INSTANCE USART_ID_1
6152  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6153  USART_RECEIVE_FIFO_ONE_CHAR );
6154  </code>
6155  Remarks:
6156  This feature may not be available on all devices. Please refer to the
6157  specific device data sheet to determine availability or use
6158  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6159  whether this feature is available.
6160 */
6161 
6162 void
6164  USART_MODULE_ID index ,
6165  USART_RECEIVE_INTR_MODE interruptMode ) ;
6166 //******************************************************************************
6167 /* Function:
6168  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6169  USART_LINECONTROL_MODE dataFlowConfig)
6170  Summary:
6171  Sets the data flow configuration.
6172  Description:
6173  This function sets the USART data flow configuration based on the mask
6174  provided and the specified baud rate.
6175  Precondition:
6176  None.
6177  Parameters:
6178  index - Identifier for the device instance to be configured
6179  mode - For possible data flow configurations, refer to
6180  USART_LINECONTROL_MODE
6181  Returns:
6182  None.
6183  Example:
6184  <code>
6185 #define MY_USART_INSTANCE USART_ID_1
6186  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6187  USART_8N1);
6188  </code>
6189  Remarks:
6190  This feature may not be available on all devices. Please refer to the
6191  specific device data sheet to determine availability or use
6192  PLIB_USART_ExistsLineControlMode in your application to determine
6193  whether this feature is available.
6194 */
6195 
6196 void
6198  USART_MODULE_ID index ,
6199  USART_LINECONTROL_MODE dataFlowConfig ) ;
6200 //******************************************************************************
6201 /* Function:
6202  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6203  USART_HANDSHAKE_MODE handshakeConfig)
6204  Summary:
6205  Sets the data flow configuration.
6206  Description:
6207  This function sets the USART data flow configuration based on the mask
6208  provided and the specified baud rate.
6209  Precondition:
6210  None.
6211  Parameters:
6212  index - Identifier for the device instance to be configured
6213  mode - For possible data flow configurations, refer to
6214  USART_HANDSHAKE_MODE
6215  Returns:
6216  None.
6217  Example:
6218  <code>
6219 #define MY_USART_INSTANCE USART_ID_1
6220  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6221  USART_HANDSHAKE_MODE_SIMPLEX);
6222  </code>
6223  Remarks:
6224  This feature may not be available on all devices. Please refer to the
6225  specific device data sheet to determine availability or use
6226  PLIB_USART_ExistsHandshakeMode in your application to determine
6227  whether this feature is available.
6228 */
6229 
6230 void
6232  USART_MODULE_ID index ,
6233  USART_HANDSHAKE_MODE handshakeConfig ) ;
6234 //******************************************************************************
6235 /* Function:
6236  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6237  int8_t Mask)
6238  Summary:
6239  Setup the automatic Address Detect mode.
6240  Description:
6241  This function configures the automatic Address Detect mode. Uses the mask as
6242  the address character for automatic address detection.
6243  This operation is atomic.
6244  Precondition:
6245  None.
6246  Parameters:
6247  index - Identifier for the device instance to be configured
6248  Mask - Address character to be used, when enabled
6249  Returns:
6250  None.
6251  Example:
6252  <code>
6253 #define MY_USART_INSTANCE USART_ID_1
6254  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6255  MY_DEVICE_ADDRESS);
6256  </code>
6257  Remarks:
6258  This feature may not be available on all devices. Please refer to the
6259  specific device data sheet to determine availability or use
6260  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6261  whether this feature is available.
6262 */
6263 
6264 void
6266  USART_MODULE_ID index ,
6267  int8_t Mask ) ;
6268 //******************************************************************************
6269 /* Function:
6270  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6271  USART_MODULE_ID index )
6272  Summary:
6273  Disables the automatic Address Detect mode.
6274  Description:
6275  This function disables the automatic Address Detect mode.
6276  This operation is atomic.
6277  Precondition:
6278  None.
6279  Parameters:
6280  index - Identifier for the device instance to be configured
6281  Returns:
6282  None.
6283  Example:
6284  <code>
6285 #define MY_USART_INSTANCE USART_ID_1
6286  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6287  </code>
6288  Remarks:
6289  This feature may not be available on all devices. Please refer to the
6290  specific device data sheet to determine availability or use
6291  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6292  whether this feature is available.
6293 */
6294 
6295 void
6297  USART_MODULE_ID index ) ;
6298 //******************************************************************************
6299 /* Function:
6300  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6301  Summary:
6302  Enables the IrDA encoder and decoder.
6303  Description:
6304  This function enables the IrDA encoder and decoder.
6305  This operation is atomic.
6306  Precondition:
6307  None.
6308  Parameters:
6309  index - Identifier for the device instance to be configured
6310  Returns:
6311  None.
6312  Example:
6313  <code>
6314 #define MY_USART_INSTANCE USART_ID_1
6315  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6316  </code>
6317  Remarks:
6318  This feature may not be available on all devices. Please refer to the
6319  specific device data sheet to determine availability or use
6320  PLIB_USART_ExistsIrDA in your application to determine
6321  whether this feature is available.
6322 */
6323 
6324 void
6326  USART_MODULE_ID index ) ;
6327 //******************************************************************************
6328 /* Function:
6329  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6330  Summary:
6331  Disables the IrDA encoder and decoder.
6332  Description:
6333  This function disables the IrDA encoder and decoder.
6334  This operation is atomic.
6335  Precondition:
6336  None.
6337  Parameters:
6338  index - Identifier for the device instance to be configured
6339  Returns:
6340  None.
6341  Example:
6342  <code>
6343 #define MY_USART_INSTANCE USART_ID_1
6344  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6345  </code>
6346  Remarks:
6347  By default, the IrDA Encoder and Decoder are disabled.
6348 
6349  This feature may not be available on all devices. Please refer to the
6350  specific device data sheet to determine availability or use
6351  PLIB_USART_ExistsIrDA in your application to determine
6352  whether this feature is available.
6353 */
6354 
6355 void
6357  USART_MODULE_ID index ) ;
6358 //******************************************************************************
6359 /* Function:
6360  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6361  Summary:
6362  Enables Loopback mode.
6363  Description:
6364  This function enables Loopback mode.
6365  This operation is atomic.
6366  Precondition:
6367  None.
6368  Parameters:
6369  index - Identifier for the device instance to be configured
6370  Returns:
6371  None.
6372  Example:
6373  <code>
6374 #define MY_USART_INSTANCE USART_ID_1
6375  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6376  </code>
6377  Remarks:
6378  By default, Loopback mode is disabled.
6379 
6380  This feature may not be available on all devices. Please refer to the
6381  specific device data sheet to determine availability or use
6382  PLIB_USART_ExistsLoopback in your application to determine
6383  whether this feature is available.
6384 */
6385 
6386 void
6388  USART_MODULE_ID index ) ;
6389 //******************************************************************************
6390 /* Function:
6391  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6392  Summary:
6393  Disables Loopback mode.
6394  Description:
6395  This function disables Loopback mode.
6396  This operation is atomic.
6397  Precondition:
6398  None.
6399  Parameters:
6400  index - Identifier for the device instance to be configured
6401  Returns:
6402  None.
6403  Example:
6404  <code>
6405 #define MY_USART_INSTANCE USART_ID_1
6406  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6407  </code>
6408  Remarks:
6409  By default, Loopback mode is disabled.
6410  This feature may not be available on all devices. Please refer to the
6411  specific device data sheet to determine availability or use
6412  PLIB_USART_ExistsLoopback in your application to determine
6413  whether this feature is available.
6414 */
6415 
6416 void
6418  USART_MODULE_ID index ) ;
6419 //******************************************************************************
6420 /* Function:
6421  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6422  USART_OPERATION_MODE operationmode)
6423  Summary:
6424  Configures the operation mode of the USART module.
6425  Description:
6426  This function configures the operation mode of the USART (i.e., controls the
6427  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6428  possible settings.
6429  Precondition:
6430  None.
6431  Parameters:
6432  index - Identifier for the device instance to be configured
6433  operationmode - One of the possible values from USART_OPERATION_MODE
6434  Returns:
6435  None.
6436  Example:
6437  <code>
6438 #define MY_USART_INSTANCE USART_ID_1
6439  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6440  </code>
6441  Remarks:
6442  This feature may not be available on all devices. Please refer to the
6443  specific device data sheet to determine availability or use
6444  PLIB_USART_ExistsOperationMode in your application to determine
6445  whether this feature is available.
6446 */
6447 
6448 void
6450  USART_MODULE_ID index ,
6451  USART_OPERATION_MODE operationmode ) ;
6452 //******************************************************************************
6453 /* Function:
6454  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6455  Summary:
6456  Discontinues operation when the device enters Idle mode.
6457  Description:
6458  This function enables the USART module to discontinue operation when the
6459  device enters Idle mode.
6460  This operation is atomic.
6461  Precondition:
6462  None.
6463  Parameters:
6464  index - Identifier for the device instance to be configured
6465  Returns:
6466  None.
6467  Example:
6468  <code>
6469 #define MY_USART_INSTANCE USART_ID_1
6470  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6471  </code>
6472  Remarks:
6473  This feature may not be available on all devices. Please refer to the
6474  specific device data sheet to determine availability or use
6475  PLIB_USART_ExistsStopInIdle in your application to determine
6476  whether this feature is available.
6477 */
6478 
6479 void
6481  USART_MODULE_ID index ) ;
6482 //******************************************************************************
6483 /* Function:
6484  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6485  Summary:
6486  Disables the Stop in Idle mode (the USART module continues operation when
6487  the device is in Idle mode).
6488  Description:
6489  This function disables the Stop in Idle mode. The USART module continues
6490  operation when the device is in Idle mode.
6491  This operation is atomic.
6492  Precondition:
6493  None.
6494  Parameters:
6495  index - Identifier for the device instance to be configured
6496  Returns:
6497  None.
6498  Example:
6499  <code>
6500 #define MY_USART_INSTANCE USART_ID_1
6501  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6502  </code>
6503  Remarks:
6504  By default, the USART module will continue operation in Idle mode.
6505 
6506  This feature may not be available on all devices. Please refer to the
6507  specific device data sheet to determine availability or use
6508  PLIB_USART_ExistsStopInIdle in your application to determine
6509  whether this feature is available.
6510 */
6511 
6512 void
6514  USART_MODULE_ID index ) ;
6515 //******************************************************************************
6516 /* Function:
6517  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6518  Summary:
6519  Enables the wake-up on start bit detection feature during Sleep mode.
6520  Description:
6521  This function enables the wake-up on start feature during Sleep mode.
6522  This operation is atomic.
6523  Precondition:
6524  None.
6525  Parameters:
6526  index - Identifier for the device instance to be configured
6527  Returns:
6528  None.
6529  Example:
6530  <code>
6531 #define MY_USART_INSTANCE USART_ID_1
6532  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6533  </code>
6534  Remarks:
6535  This feature may not be available on all devices. Please refer to the
6536  specific device data sheet to determine availability or use
6537  PLIB_USART_ExistsWakeOnStart in your application to determine
6538  whether this feature is available.
6539 */
6540 
6541 void
6543  USART_MODULE_ID index ) ;
6544 //******************************************************************************
6545 /* Function:
6546  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
6547  Summary:
6548  Disables the wake-up on start bit detection feature during Sleep mode.
6549  Description:
6550  This function disables the wake-up on start bit detection feature during
6551  Sleep mode.
6552  This operation is atomic.
6553  Precondition:
6554  None.
6555  Parameters:
6556  index - Identifier for the device instance to be configured
6557  Returns:
6558  None.
6559  Example:
6560  <code>
6561 #define MY_USART_INSTANCE USART_ID_1
6562  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
6563  </code>
6564  Remarks:
6565  This feature may not be available on all devices. Please refer to the
6566  specific device data sheet to determine availability or use
6567  PLIB_USART_ExistsWakeOnStart in your application to determine
6568  whether this feature is available.
6569 */
6570 
6571 void
6573  USART_MODULE_ID index ) ;
6574 //******************************************************************************
6575 /* Function:
6576  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
6577  Summary:
6578  Gets the state of the sync break event completion.
6579  Description:
6580  This function returns the status of the sync break event, when called
6581  after enabling using PLIB_USART_WakeOnStartEnable.
6582  This operation is atomic.
6583  Precondition:
6584  None.
6585  Parameters:
6586  index - Identifier for the device instance to be configured
6587  Returns:
6588  None.
6589  Example:
6590  <code>
6591 #define MY_USART_INSTANCE USART_ID_1
6592  //Call the interface just prior to entering the sleep mode.
6593  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6594  // Check the status if the Sync break event is over.
6595  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
6596  {
6597  // Do Something
6598  }
6599  </code>
6600  Remarks:
6601  This feature may not be available on all devices. Please refer to the
6602  specific device data sheet to determine availability or use
6603  PLIB_USART_ExistsWakeOnStart in your application to determine
6604  whether this feature is available.
6605 */
6606 
6607 bool
6609  USART_MODULE_ID index ) ;
6610 //******************************************************************************
6611 /* Function:
6612  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
6613  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
6614  Summary:
6615  Enables or disables general features of the USART module.
6616  Description:
6617  This function enables or disables general features of the USART module.
6618  Precondition:
6619  None.
6620  Parameters:
6621  index - Identifier for the device instance to be configured
6622  autobaud - If true, auto baud rate detection is enabled. If false
6623  the feature is disabled.
6624  loopBackMode - If true, loop back is enabled. If false the feature is
6625  disabled.
6626  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
6627  mode on USART activity. If false the feature is disabled.
6628  irdaMode - If true, the IrDA mode is enabled. If false the feature
6629  is disabled.
6630  stopInIdle - If true, module will stop functioning when CPU enters Idle
6631  mode. If false, the feature is disabled.
6632  Returns:
6633  None.
6634  Example:
6635  <code>
6636 #define MY_USART_INSTANCE USART_ID_1
6637  // Enable loopback, disable IrDA, disable auto baud detection and disable
6638  // wake from sleep. Enable stop in idle
6639  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
6640  false, false, true);
6641  </code>
6642  Remarks:
6643  Enabling the wake from sleep feature will cause the first character that is
6644  received by the USART module to be discarded. This feature should only be
6645  enabled if the CPU is to placed in power saving mode.
6646 
6647  This feature may not be available on all devices. Please refer to the
6648  specific device data sheet to determine availability. Availability of this
6649  function can also be determined if all of the following functions return
6650  true:
6651  - PLIB_USART_ExistsLoopback
6652  - PLIB_USART_ExistsBaudRateAutoDetect
6653  - PLIB_USART_ExistsWakeOnStart
6654  - PLIB_USART_ExistsIrDA
6655  - PLIB_USART_ExistsStopInIdle
6656 */
6657 
6658 void
6660  USART_MODULE_ID index ,
6661  bool autobaud ,
6662  bool loopBackMode ,
6663  bool wakeFromSleep ,
6664  bool irdaMode ,
6665  bool stopInIdle ) ;
6666 //******************************************************************************
6667 /* Function:
6668  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
6669  USART_RECEIVE_INTR_MODE receiveInterruptMode,
6670  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
6671  USART_OPERATION_MODE operationMode);
6672  Summary:
6673  Configures the Receive and Transmit FIFO interrupt levels and the hardware
6674  lines to be used by the module.
6675  Description:
6676  This function configures the Receive and Transmit FIFO interrupt levels and
6677  the hardware lines to be used by the module.
6678  Precondition:
6679  None.
6680  Parameters:
6681  index - Identifier for the device instance to be configured
6682  receiveInterruptMode - Receiver FIFO interrupt level
6683  transmitInterruptMode - Transmit FIFO interrupt level
6684  operationMode - Hardware lines to be used by the USART.
6685  Returns:
6686  None.
6687  Example:
6688  <code>
6689 #define MY_USART_INSTANCE USART_ID_1
6690  // Set receive FIFO to interrupt when FIFO is 3/4 level full
6691  // Set Transmit FIFO to interrupt when FIFO is empty
6692  // USART module will only use RX and TX hardware lines
6693  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
6694  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
6695  </code>
6696  Remarks:
6697  This feature may not be available on all devices. Please refer to the
6698  specific device data sheet to determine availability. Availability of this
6699  function can also be determined if all of the following functions return
6700  true:
6701  - PLIB_USART_ExistsReceiverInterruptMode
6702  - PLIB_USART_ExistsTransmitterInterruptMode
6703  - PLIB_USART_ExistsOperationMode
6704 */
6705 
6706 void
6708  USART_MODULE_ID index ,
6709  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
6710  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
6711  USART_OPERATION_MODE operationMode ) ;
6712 //******************************************************************************
6713 /* Function:
6714  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
6715  clockFrequency, uint32_t baudRate );
6716  Summary:
6717  Sets the baud rate to the desired value and enables the USART receiver,
6718  transmitter and the USART module.
6719  Description:
6720  This function sets the baud rate to the desired value and enables the USART
6721  receiver, USART transmitter and USART module.
6722  Precondition:
6723  None.
6724  Parameters:
6725  index - Identifier for the device instance to be configured
6726  baudRate - Baud Rate Value
6727  clockFrequency - Clock Frequency
6728  Returns:
6729  None.
6730  Example:
6731  <code>
6732 #define MY_USART_INSTANCE USART_ID_1
6733  uint32_t baudRateValue ;
6734  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
6735  </code>
6736  Remarks:
6737  Setting a new baud rate value causes the baud rate timer to reset.
6738  This ensures that the baud rate timer does not have to overflow before
6739  outputting the new baud rate.
6740 
6741  If the system clock is changed during an active receive operation, a
6742  receiver error or data loss may result. To avoid this issue verify that
6743  no receptions are in progress before changing the system clock.
6744 
6745  This feature may not be available on all devices. Please refer to the
6746  specific device data sheet to determine availability. Availability of this
6747  function can also be determined if all of the following functions return
6748  true:
6749  - PLIB_USART_ExistsBaudRate
6750  - PLIB_USART_ExistsTransmitterEnable
6751  - PLIB_USART_ExistsReceiverEnable
6752  - PLIB_USART_ExistsEnable
6753 */
6754 
6755 void
6757  USART_MODULE_ID index ,
6758  uint32_t systemClock ,
6759  uint32_t baud ) ;
6760 //******************************************************************************
6761 /* Function:
6762  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
6763  Summary:
6764  Return the status of all errors in the specified USART module.
6765  Description:
6766  This function returns status of all errors in the specified USART module.
6767  The return value can be bitwise AND'ed with a USART_ERROR type to know the
6768  status of a specific error.
6769  This operation is atomic.
6770  Precondition:
6771  None.
6772  Parameters:
6773  index - Identifier for the device instance to be configured
6774  Returns:
6775  Returns a bitmap of USART error status.
6776  Example:
6777  <code>
6778 #define MY_USART_INSTANCE USART_ID_1
6779  USART_ERROR error;
6780  // Get the status of all errors.
6781  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
6782  // Check if parity error is active
6783  if(error & USART_ERROR_PARITY)
6784  {
6785  // Parity error is active.
6786  }
6787  else if(error & USART_ERROR_FRAMING)
6788  {
6789  // Framing error is active.
6790  }
6791  </code>
6792  Remarks:
6793  This feature may not be available on all devices. Please refer to the
6794  specific device data sheet to determine availability. Availability of this
6795  function can also be determined if all of the followings functions return
6796  true:
6797  - PLIB_USART_ExistsReceiverFramingErrorStatus
6798  - PLIB_USART_ExistsReceiverParityErrorStatus
6799  - PLIB_USART_ExistsReceiverOverrunStatus
6800 */
6801 
6802 USART_ERROR
6804  USART_MODULE_ID index ) ;
6805 //******************************************************************************
6806 /* Function:
6807  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
6808  Summary:
6809  Returns the address of the USART TX register
6810  Description:
6811  This function returns the address of the USART TX register.
6812  This operation is atomic.
6813  Preconditions:
6814  None.
6815  Parameters:
6816  index - Identifier for the device instance
6817  Returns:
6818  Address of the USART TX register
6819  Remarks:
6820  None.
6821 */
6822 
6823 void *
6825  USART_MODULE_ID index ) ;
6826 //******************************************************************************
6827 /* Function:
6828  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
6829  Summary:
6830  Returns the address of the USART RX register
6831  Description:
6832  This function returns the address of the USART RX register.
6833  This operation is atomic.
6834  Preconditions:
6835  None.
6836  Parameters:
6837  index - Identifier for the device instance
6838  Returns:
6839  Address of the USART RX register
6840  Remarks:
6841  None.
6842 */
6843 
6844 void *
6846  USART_MODULE_ID index ) ;
6847 // *****************************************************************************
6848 // *****************************************************************************
6849 // Section: USART Peripheral Library Exists Functions
6850 // *****************************************************************************
6851 // *****************************************************************************
6852 /* The following functions indicate the existence of the features on the device.
6853 */
6854 //******************************************************************************
6855 /* Function:
6856  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
6857  Summary:
6858  Identifies whether the Run in overflow condition feature exists on the USART module.
6859  Description:
6860  This function identifies whether the Run in Overflow condition feature is
6861  available on the USART module. When this function returns true, these
6862  functions are supported on the device:
6863  - PLIB_USART_RunInOverflowEnable
6864  - PLIB_USART_RunInOverflowDisable
6865  - PLIB_USART_RunInOverflowIsEnabled
6866  This operation is atomic.
6867  Preconditions:
6868  None.
6869  Parameters:
6870  index - Identifier for the device instance
6871  Returns:
6872  - true - The Run in Overflow condition feature is supported on the device
6873  - false - The Run in Overflow condition feature is not supported on the device
6874  Remarks:
6875  None.
6876 */
6877 
6878 bool
6880  USART_MODULE_ID index ) ;
6881 //******************************************************************************
6882 /* Function:
6883  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
6884  Summary:
6885  Identifies whether the BRG Clock source select feature exists on the
6886  USART module.
6887  Description:
6888  This function identifies whether the BRG Clock source select feature is
6889  available on the USART module. When this function returns true, these
6890  functions are supported on the device:
6891  - PLIB_USART_BRGClockSourceSelect
6892  - PLIB_USART_BRGClockSourceGet
6893  This operation is atomic.
6894  Preconditions:
6895  None.
6896  Parameters:
6897  index - Identifier for the device instance
6898  Returns:
6899  - true - The BRG clock source select feature is supported on the device
6900  - false - The BRG clock source select feature is not supported on the device
6901  Remarks:
6902  None.
6903 */
6904 
6905 bool
6907  USART_MODULE_ID index ) ;
6908 //******************************************************************************
6909 /* Function:
6910  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
6911  Summary:
6912  Identifies whether the module running status feature exists on the
6913  USART module.
6914  Description:
6915  This function identifies whether the module running status feature is
6916  available on the USART module. When this function returns true, this
6917  function is supported on the device:
6918  - PLIB_USART_ModuleIsBusy
6919  This operation is atomic.
6920  Preconditions:
6921  None.
6922  Parameters:
6923  index - Identifier for the device instance
6924  Returns:
6925  - true - The Module running status feature is supported on the device
6926  - false - The Module running status feature is not supported on the device
6927  Remarks:
6928  None.
6929 */
6930 
6931 bool
6933  USART_MODULE_ID index ) ;
6934 //******************************************************************************
6935 /* Function:
6936  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
6937  Summary:
6938  Identifies whether the Run in Sleep mode feature exists on the USART module.
6939  Description:
6940  This function identifies whether the Run in Sleep mode feature is
6941  available on the USART module. When this function returns true, these
6942  functions are supported on the device:
6943  - PLIB_USART_RunInSleepModeEnable
6944  - PLIB_USART_RunInSleepModeDisable
6945  - PLIB_USART_RunInSleepModeIsEnabled
6946  This operation is atomic.
6947  Preconditions:
6948  None.
6949  Parameters:
6950  index - Identifier for the device instance
6951  Returns:
6952  - true - The Run in Sleep mode feature is supported on the device
6953  - false - The Run in Sleep mode feature is not supported on the device
6954  Remarks:
6955  None.
6956 */
6957 
6958 bool
6960  USART_MODULE_ID index ) ;
6961 //******************************************************************************
6962 /* Function:
6963  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
6964  Summary:
6965  Identifies whether the EnableControl feature exists on the USART module.
6966  Description:
6967  This function identifies whether the EnableControl feature is
6968  available on the USART module. When this function returns true, these
6969  functions are supported on the device:
6970  - PLIB_USART_Disable
6971  - PLIB_USART_Enable
6972  This operation is atomic.
6973  Preconditions:
6974  None.
6975  Parameters:
6976  index - Identifier for the device instance
6977  Returns:
6978  - true - The EnableControl feature is supported on the device
6979  - false - The EnableControl feature is not supported on the device
6980  Remarks:
6981  None.
6982 */
6983 
6984 bool
6986  USART_MODULE_ID index ) ;
6987 //******************************************************************************
6988 /* Function:
6989  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
6990  Summary:
6991  Identifies whether the HandShakeMode feature exists on the USART module.
6992  Description:
6993  This function identifies whether the HandShakeMode feature is
6994  available on the USART module. When this function returns true, this
6995  function is supported on the device:
6996  - PLIB_USART_HandshakeModeSelect
6997  This operation is atomic.
6998  Preconditions:
6999  None.
7000  Parameters:
7001  index - Identifier for the device instance
7002  Returns:
7003  - true - The HandShakeMode feature is supported on the device
7004  - false - The HandShakeMode feature is not supported on the device
7005  Remarks:
7006  None.
7007 */
7008 
7009 bool
7011  USART_MODULE_ID index ) ;
7012 //******************************************************************************
7013 /* Function:
7014  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7015  Summary:
7016  Identifies whether the IrDAControl feature exists on the USART module.
7017  Description:
7018  This function identifies whether the IrDAControl feature is
7019  available on the USART module. When this function returns true, these
7020  functions are supported on the device:
7021  - PLIB_USART_IrDADisable
7022  - PLIB_USART_IrDAEnable
7023  This operation is atomic.
7024  Preconditions:
7025  None.
7026  Parameters:
7027  index - Identifier for the device instance
7028  Returns:
7029  - true - The IrDAControl feature is supported on the device
7030  - false - The IrDAControl feature is not supported on the device
7031  Remarks:
7032  None.
7033 */
7034 
7035 bool
7037  USART_MODULE_ID index ) ;
7038 //******************************************************************************
7039 /* Function:
7040  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7041  Summary:
7042  Identifies whether the LineControlMode feature exists on the USART module.
7043  Description:
7044  This function identifies whether the LineControlMode feature is
7045  available on the USART module. When this function returns true, this
7046  function is supported on the device:
7047  - PLIB_USART_LineControlModeSelect
7048  This operation is atomic.
7049  Preconditions:
7050  None.
7051  Parameters:
7052  index - Identifier for the device instance
7053  Returns:
7054  - true - The LineControlMode feature is supported on the device
7055  - false - The LineControlMode feature is not supported on the device
7056  Remarks:
7057  None.
7058 */
7059 
7060 bool
7062  USART_MODULE_ID index ) ;
7063 //******************************************************************************
7064 /* Function:
7065  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7066  Summary:
7067  Identifies whether the Loopback feature exists on the USART module.
7068  Description:
7069  This function identifies whether the Loopback feature is
7070  available on the USART module. When this function returns true, these
7071  functions are supported on the device:
7072  - PLIB_USART_LoopbackEnable
7073  - PLIB_USART_LoopbackDisable
7074  This operation is atomic.
7075  Preconditions:
7076  None.
7077  Parameters:
7078  index - Identifier for the device instance
7079  Returns:
7080  - true - The Loopback feature is supported on the device
7081  - false - The Loopback feature is not supported on the device
7082  Remarks:
7083  None.
7084 */
7085 
7086 bool
7088  USART_MODULE_ID index ) ;
7089 //******************************************************************************
7090 /* Function:
7091  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7092  Summary:
7093  Identifies whether the OperationMode feature exists on the USART module.
7094  Description:
7095  This function identifies whether the OperationMode feature is
7096  available on the USART module. When this function returns true, this
7097  function is supported on the device:
7098  - PLIB_USART_OperationModeSelect
7099  This operation is atomic.
7100  Preconditions:
7101  None.
7102  Parameters:
7103  index - Identifier for the device instance
7104  Returns:
7105  - true - The OperationMode feature is supported on the device
7106  - false - The OperationMode feature is not supported on the device
7107  Remarks:
7108  None.
7109 */
7110 
7111 bool
7113  USART_MODULE_ID index ) ;
7114 //******************************************************************************
7115 /* Function:
7116  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7117  Summary:
7118  Identifies whether the StopInIdle feature exists on the USART module.
7119  Description:
7120  This function identifies whether the StopInIdle feature is
7121  available on the USART module. When this function returns true, these
7122  functions are supported on the device:
7123  - PLIB_USART_StopInIdleEnable
7124  - PLIB_USART_StopInIdleDisable
7125  This operation is atomic.
7126  Preconditions:
7127  None.
7128  Parameters:
7129  index - Identifier for the device instance
7130  Returns:
7131  - true - The StopInIdle feature is supported on the device
7132  - false - The StopInIdle feature is not supported on the device
7133  Remarks:
7134  None.
7135 */
7136 
7137 bool
7139  USART_MODULE_ID index ) ;
7140 //******************************************************************************
7141 /* Function:
7142  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7143  Summary:
7144  Identifies whether the WakeOnStart feature exists on the USART module.
7145  Description:
7146  This function identifies whether the WakeOnStart feature is
7147  available on the USART module. When this function returns true, these
7148  functions are supported on the device:
7149  - PLIB_USART_WakeOnStartEnable
7150  - PLIB_USART_WakeOnStartDisable
7151  - PLIB_USART_WakeOnStartIsEnabled
7152  This operation is atomic.
7153  Preconditions:
7154  None.
7155  Parameters:
7156  index - Identifier for the device instance
7157  Returns:
7158  - true - The WakeOnStart feature is supported on the device
7159  - false - The WakeOnStart feature is not supported on the device
7160  Remarks:
7161  None.
7162 */
7163 
7164 bool
7166  USART_MODULE_ID index ) ;
7167 //******************************************************************************
7168 /* Function:
7169  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7170  Summary:
7171  Identifies whether the BaudRate feature exists on the USART module.
7172  Description:
7173  This function identifies whether the BaudRate feature is
7174  available on the USART module. When this function returns true, these
7175  functions are supported on the device:
7176  - PLIB_USART_BaudRateSet
7177  - PLIB_USART_BaudRateGet
7178  This operation is atomic.
7179  Preconditions:
7180  None.
7181  Parameters:
7182  index - Identifier for the device instance
7183  Returns:
7184  - true - The BaudRate feature is supported on the device
7185  - false - The BaudRate feature is not supported on the device
7186  Remarks:
7187  None.
7188 */
7189 
7190 bool
7192  USART_MODULE_ID index ) ;
7193 //******************************************************************************
7194 /* Function:
7195  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7196  Summary:
7197  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7198  Description:
7199  This function identifies whether the BaudRateAutoDetect feature is
7200  available on the USART module. When this function returns true, these
7201  functions are supported on the device:
7202  - PLIB_USART_BaudRateAutoDetectEnable
7203  - PLIB_USART_BaudRateAutoDetectIsComplete
7204  This operation is atomic.
7205  Preconditions:
7206  None.
7207  Parameters:
7208  index - Identifier for the device instance
7209  Returns:
7210  - true - The BaudRateAutoDetect feature is supported on the device
7211  - false - The BaudRateAutoDetect feature is not supported on the device
7212  Remarks:
7213  None.
7214 */
7215 
7216 bool
7218  USART_MODULE_ID index ) ;
7219 //******************************************************************************
7220 /* Function:
7221  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7222  Summary:
7223  Identifies whether the BaudRateHigh feature exists on the USART module.
7224  Description:
7225  This function identifies whether the BaudRateHigh feature is
7226  available on the USART module. When this function returns true, these
7227  functions are supported on the device:
7228  - PLIB_USART_BaudRateHighSet
7229  - PLIB_USART_BaudRateHighDisable
7230  - PLIB_USART_BaudRateHighEnable
7231  This operation is atomic.
7232  Preconditions:
7233  None.
7234  Parameters:
7235  index - Identifier for the device instance
7236  Returns:
7237  - true - The BaudRateHigh feature is supported on the device
7238  - false - The BaudRateHigh feature is not supported on the device
7239  Remarks:
7240  None.
7241 */
7242 
7243 bool
7245  USART_MODULE_ID index ) ;
7246 //******************************************************************************
7247 /* Function:
7248  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7249  Summary:
7250  Identifies whether the Receiver Address feature exists on the USART
7251  module.
7252  Description:
7253  This function identifies whether the Receiver Address feature is
7254  available on the USART module. When this function returns true, these
7255  functions are supported on the device:
7256  - PLIB_USART_AddressSet
7257  - PLIB_USART_AddressGet
7258  This operation is atomic.
7259  Preconditions:
7260  None.
7261  Parameters:
7262  index - Identifier for the device instance
7263  Returns:
7264  - true - The Receiver address feature is supported on the device
7265  - false - The Receiver address feature is not supported on the device
7266  Remarks:
7267  None.
7268 */
7269 
7270 bool
7272  USART_MODULE_ID index ) ;
7273 //******************************************************************************
7274 /* Function:
7275  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7276  Summary:
7277  Identifies whether the Receiver Address Mask feature exists on the USART
7278  module.
7279  Description:
7280  This function identifies whether the Receiver Address Mask feature is
7281  available on the USART module. When this function returns true, these
7282  functions are supported on the device:
7283  - PLIB_USART_AddressMaskSet
7284  - PLIB_USART_AddressMaskGet
7285  This operation is atomic.
7286  Preconditions:
7287  None.
7288  Parameters:
7289  index - Identifier for the device instance
7290  Returns:
7291  - true - The Receiver address mask feature is supported on the device
7292  - false - The Receiver address mask feature is not supported on the device
7293  Remarks:
7294  None.
7295 */
7296 
7297 bool
7299  USART_MODULE_ID index ) ;
7300 //******************************************************************************
7301 /* Function:
7302  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7303  Summary:
7304  Identifies whether the Receiver feature exists on the USART module.
7305  Description:
7306  This function identifies whether the Receiver feature is available on the
7307  USART module. When this function returns true, these functions are supported
7308  on the device:
7309  - PLIB_USART_ReceiverByteReceive
7310  - PLIB_USART_ReceiverAddressGet
7311  This operation is atomic.
7312  Preconditions:
7313  None.
7314  Parameters:
7315  index - Identifier for the device instance
7316  Returns:
7317  - true - The Receiver feature is supported on the device
7318  - false - The Receiver feature is not supported on the device
7319  Remarks:
7320  None.
7321 */
7322 
7323 bool
7325  USART_MODULE_ID index ) ;
7326 //******************************************************************************
7327 /* Function:
7328  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7329  Summary:
7330  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7331  Description:
7332  This function identifies whether the 9 Bits Receiver feature is available on the
7333  USART module. When this function returns true, this function is supported
7334  on the device:
7335  - PLIB_USART_Receiver9BitsReceive
7336  This operation is atomic.
7337  Preconditions:
7338  None.
7339  Parameters:
7340  index - Identifier for the device instance
7341  Returns:
7342  - true - The feature is supported on the device
7343  - false - The feature is not supported on the device
7344  Remarks:
7345  None.
7346 */
7347 
7348 bool
7350  USART_MODULE_ID index ) ;
7351 //******************************************************************************
7352 /* Function:
7353  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7354  Summary:
7355  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7356  Description:
7357  This function identifies whether the ReceiverAddressAutoDetect feature is
7358  available on the USART module. When this function returns true, these
7359  functions are supported on the device:
7360  - PLIB_USART_ReceiverAddressAutoDetectEnable
7361  - PLIB_USART_ReceiverAddressAutoDetectDisable
7362  This operation is atomic.
7363  Preconditions:
7364  None.
7365  Parameters:
7366  index - Identifier for the device instance
7367  Returns:
7368  - true - The ReceiverAddressAutoDetect feature is supported on the device
7369  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7370  Remarks:
7371  None.
7372 */
7373 
7374 bool
7376  USART_MODULE_ID index ) ;
7377 //******************************************************************************
7378 /* Function:
7379  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7380  Summary:
7381  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7382  Description:
7383  This function identifies whether the ReceiverAddressDetect feature is
7384  available on the USART module. When this function returns true, these
7385  functions are supported on the device:
7386  - PLIB_USART_ReceiverAddressDetectEnable
7387  - PLIB_USART_ReceiverAddressDetectDisable
7388  - PLIB_USART_ReceiverAddressIsReceived
7389  This operation is atomic.
7390  Preconditions:
7391  None.
7392  Parameters:
7393  index - Identifier for the device instance
7394  Returns:
7395  - true - The ReceiverAddressDetect feature is supported on the device
7396  - false - The ReceiverAddressDetect feature is not supported on the device
7397  Remarks:
7398  None.
7399 */
7400 
7401 bool
7403  USART_MODULE_ID index ) ;
7404 //******************************************************************************
7405 /* Function:
7406  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7407  Summary:
7408  Identifies whether the ReceiverDataAvailable feature exists on the USART
7409  module
7410  Description:
7411  This function identifies whether the ReceiverDataAvailable feature is
7412  available on the USART module. When this function returns true, this
7413  function is supported on the device:
7414  - PLIB_USART_ReceiverDataIsAvailable
7415  This operation is atomic.
7416  Preconditions:
7417  None.
7418  Parameters:
7419  index - Identifier for the device instance
7420  Returns:
7421  - true - The ReceiverDataAvailable feature is supported on the device
7422  - false - The ReceiverDataAvailable feature is not supported on the device
7423  Remarks:
7424  None.
7425 */
7426 
7427 bool
7429  USART_MODULE_ID index ) ;
7430 //******************************************************************************
7431 /* Function:
7432  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7433  Summary:
7434  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7435  Description:
7436  This function identifies whether the ReceiverEnableControl feature is
7437  available on the USART module. When this function returns true, these
7438  functions are supported on the device:
7439  - PLIB_USART_ReceiverEnable
7440  - PLIB_USART_ReceiverDisable
7441  This operation is atomic.
7442  Preconditions:
7443  None.
7444  Parameters:
7445  index - Identifier for the device instance
7446  Returns:
7447  - true - The ReceiverEnableControl feature is supported on the device
7448  - false - The ReceiverEnableControl feature is not supported on the device
7449  Remarks:
7450  None.
7451 */
7452 
7453 bool
7455  USART_MODULE_ID index ) ;
7456 //******************************************************************************
7457 /* Function:
7458  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7459  Summary:
7460  Identifies whether the ReceiverIdle feature exists on the USART module.
7461  Description:
7462  This function identifies whether the ReceiverIdle feature is
7463  available on the USART module. When this function returns true, this
7464  function is supported on the device:
7465  - PLIB_USART_ReceiverIsIdle
7466  This operation is atomic.
7467  Preconditions:
7468  None.
7469  Parameters:
7470  index - Identifier for the device instance
7471  Returns:
7472  - true - The ReceiverIdle feature is supported on the device
7473  - false - The ReceiverIdle feature is not supported on the device
7474  Remarks:
7475  None.
7476 */
7477 
7478 bool
7480  USART_MODULE_ID index ) ;
7481 //******************************************************************************
7482 /* Function:
7483  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7484  Summary:
7485  Identifies whether the ReceiverFramingError feature exists on the USART module.
7486  Description:
7487  This function identifies whether the ReceiverFramingError feature is
7488  available on the USART module. When this function returns true, this
7489  function is supported on the device:
7490  - PLIB_USART_ReceiverFramingErrorHasOccurred
7491  This operation is atomic.
7492  Preconditions:
7493  None.
7494  Parameters:
7495  index - Identifier for the device instance
7496  Returns:
7497  - true - The ReceiverFramingError feature is supported on the device
7498  - false - The ReceiverFramingError feature is not supported on the device
7499  Remarks:
7500  None.
7501 */
7502 
7503 bool
7505  USART_MODULE_ID index ) ;
7506 //******************************************************************************
7507 /* Function:
7508  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7509  Summary:
7510  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7511  Description:
7512  This function identifies whether the ReceiverInterruptMode feature is
7513  available on the USART module. When this function returns true, this
7514  function is supported on the device:
7515  - PLIB_USART_ReceiverInterruptModeSelect
7516  This operation is atomic.
7517  Preconditions:
7518  None.
7519  Parameters:
7520  index - Identifier for the device instance
7521  Returns:
7522  - true - The ReceiverInterruptMode feature is supported on the device
7523  - false - The ReceiverInterruptMode feature is not supported on the device
7524  Remarks:
7525  None.
7526 */
7527 
7528 bool
7530  USART_MODULE_ID index ) ;
7531 //******************************************************************************
7532 /* Function:
7533  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
7534  Summary:
7535  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
7536  Description:
7537  This function identifies whether the ReceiverPolarityInvert feature is
7538  available on the USART module. When this function returns true, these
7539  functions are supported on the device:
7540  - PLIB_USART_ReceiverIdleStateLowEnable
7541  - PLIB_USART_ReceiverIdleStateLowDisable
7542  This operation is atomic.
7543  Preconditions:
7544  None.
7545  Parameters:
7546  index - Identifier for the device instance
7547  Returns:
7548  - true - The ReceiverPolarityInvert feature is supported on the device
7549  - false - The ReceiverPolarityInvert feature is not supported on the device
7550  Remarks:
7551  None.
7552 */
7553 
7554 bool
7556  USART_MODULE_ID index ) ;
7557 //******************************************************************************
7558 /* Function:
7559  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
7560  Summary:
7561  Identifies whether the ReceiverParityError feature exists on the USART module.
7562  Description:
7563  This function identifies whether the ReceiverParityError feature is
7564  available on the USART module. When this function returns true, this
7565  function is supported on the device:
7566  - PLIB_USART_ReceiverParityErrorHasOccurred
7567  This operation is atomic.
7568  Preconditions:
7569  None.
7570  Parameters:
7571  index - Identifier for the device instance
7572  Returns:
7573  - true - The ReceiverParityError feature is supported on the device
7574  - false - The ReceiverParityError feature is not supported on the device
7575  Remarks:
7576  None.
7577 */
7578 
7579 bool
7581  USART_MODULE_ID index ) ;
7582 //******************************************************************************
7583 /* Function:
7584  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
7585  Summary:
7586  Identifies whether the ReceiverOverrunError feature exists on the USART module.
7587  Description:
7588  This function identifies whether the ReceiverOverrunError feature is
7589  available on the USART module. When this function returns true, these
7590  functions are supported on the device:
7591  - PLIB_USART_ReceiverOverrunErrorClear
7592  - PLIB_USART_ReceiverOverrunHasOccurred
7593  This operation is atomic.
7594  Preconditions:
7595  None.
7596  Parameters:
7597  index - Identifier for the device instance
7598  Returns:
7599  - true - The ReceiverOverrunError feature is supported on the device
7600  - false - The ReceiverOverrunError feature is not supported on the device
7601  Remarks:
7602  None.
7603 */
7604 
7605 bool
7607  USART_MODULE_ID index ) ;
7608 //******************************************************************************
7609 /* Function:
7610  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
7611  Summary:
7612  Identifies whether the Transmitter feature exists on the USART module.
7613  Description:
7614  This function identifies whether the Transmitter feature is
7615  available on the USART module. When this function returns true, these
7616  functions are supported on the device:
7617  - PLIB_USART_TransmitterByteSend
7618  - PLIB_USART_TransmitterAddressGet
7619  This operation is atomic.
7620  Preconditions:
7621  None.
7622  Parameters:
7623  index - Identifier for the device instance
7624  Returns:
7625  - true - The Transmitter feature is supported on the device
7626  - false - The Transmitter feature is not supported on the device
7627  Remarks:
7628  None.
7629 */
7630 
7631 bool
7633  USART_MODULE_ID index ) ;
7634 //******************************************************************************
7635 /* Function:
7636  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
7637  Summary:
7638  Identifies whether the Transmitter9Bits feature exists on the USART module.
7639  Description:
7640  This function identifies whether the Transmitter9Bits feature is
7641  available on the USART module. When this function returns true, this
7642  function is supported on the device:
7643  - PLIB_USART_Transmitter9BitsSend
7644  This operation is atomic.
7645  Preconditions:
7646  None.
7647  Parameters:
7648  index - Identifier for the device instance
7649  Returns:
7650  - true - The Transmitter9Bits feature is supported on the device
7651  - false - The Transmitter9Bits feature is not supported on the device
7652  Remarks:
7653  None.
7654 */
7655 
7656 bool
7658  USART_MODULE_ID index ) ;
7659 //******************************************************************************
7660 /* Function:
7661  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
7662  Summary:
7663  Identifies whether the TransmitterBreak feature exists on the USART module.
7664  Description:
7665  This function identifies whether the TransmitterBreak feature is
7666  available on the USART module. When this function returns true, these
7667  functions are supported on the device:
7668  - PLIB_USART_TransmitterBreakSend
7669  - PLIB_USART_TransmitterBreakSendIsComplete
7670  This operation is atomic.
7671  Preconditions:
7672  None.
7673  Parameters:
7674  index - Identifier for the device instance
7675  Returns:
7676  - true - The TransmitterBreak feature is supported on the device
7677  - false - The TransmitterBreak feature is not supported on the device
7678  Remarks:
7679  None.
7680 */
7681 
7682 bool
7684  USART_MODULE_ID index ) ;
7685 //******************************************************************************
7686 /* Function:
7687  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
7688  Summary:
7689  Identifies whether the TransmitterBufferFull feature exists on the USART module.
7690  Description:
7691  This function identifies whether the TransmitterBufferFull feature is
7692  available on the USART module. When this function returns true, this
7693  function is supported on the device:
7694  - PLIB_USART_TransmitterBufferIsFull
7695  This operation is atomic.
7696  Preconditions:
7697  None.
7698  Parameters:
7699  index - Identifier for the device instance
7700  Returns:
7701  - true - The TransmitterBufferFull feature is supported on the device
7702  - false - The TransmitterBufferFull feature is not supported on the device
7703  Remarks:
7704  None.
7705 */
7706 
7707 bool
7709  USART_MODULE_ID index ) ;
7710 //******************************************************************************
7711 /* Function:
7712  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
7713  Summary:
7714  Identifies whether the TransmitterEmpty feature exists on the USART module.
7715  Description:
7716  This function identifies whether the TransmitterEmpty feature is
7717  available on the USART module. When this function returns true, this
7718  function is supported on the device:
7719  - PLIB_USART_TransmitterIsEmpty
7720  This operation is atomic.
7721  Preconditions:
7722  None.
7723  Parameters:
7724  index - Identifier for the device instance
7725  Returns:
7726  - true - The TransmitterEmpty feature is supported on the device
7727  - false - The TransmitterEmpty feature is not supported on the device
7728  Remarks:
7729  None.
7730 */
7731 
7732 bool
7734  USART_MODULE_ID index ) ;
7735 //******************************************************************************
7736 /* Function:
7737  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
7738  Summary:
7739  Identifies whether the TransmitterEnableControl feature exists on the USART
7740  module
7741  Description:
7742  This function identifies whether the TransmitterEnableControl feature is
7743  available on the USART module. When this function returns true, these
7744  functions are supported on the device:
7745  - PLIB_USART_TransmitterEnable
7746  - PLIB_USART_TransmitterDisable
7747  This operation is atomic.
7748  Preconditions:
7749  None.
7750  Parameters:
7751  index - Identifier for the device instance
7752  Returns:
7753  - true - The TransmitterEnableControl feature is supported on the device
7754  - false - The TransmitterEnableControl feature is not supported on the device
7755  Remarks:
7756  None.
7757 */
7758 
7759 bool
7761  USART_MODULE_ID index ) ;
7762 //******************************************************************************
7763 /* Function:
7764  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
7765  Summary:
7766  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
7767  Description:
7768  This function identifies whether the TransmitterInterruptMode feature is
7769  available on the USART module. When this function returns true, this function
7770  is supported on the device:
7771  - PLIB_USART_TransmitterInterruptModeSelect
7772  This operation is atomic.
7773  Preconditions:
7774  None.
7775  Parameters:
7776  index - Identifier for the device instance
7777  Returns:
7778  - true - The TransmitterInterruptMode feature is supported on the device
7779  - false - The TransmitterInterruptMode feature is not supported on the device
7780  Remarks:
7781  None.
7782 */
7783 
7784 bool
7786  USART_MODULE_ID index ) ;
7787 //******************************************************************************
7788 /* Function:
7789  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
7790  Summary:
7791  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
7792  Description:
7793  This function identifies whether the TransmitterIdleIsLow feature is available
7794  on the USART module. When this function returns true, these functions are
7795  supported on the device:
7796  - PLIB_USART_TransmitterIdleIsLowDisable
7797  - PLIB_USART_TransmitterIdleIsLowEnable
7798  This operation is atomic.
7799  Preconditions:
7800  None.
7801  Parameters:
7802  index - Identifier for the device instance
7803  Returns:
7804  - true - The TransmitterIdleIsLow feature is supported on the device
7805  - false - The TransmitterIdleIsLow feature is not supported on the device
7806  Remarks:
7807  None.
7808 */
7809 
7810 bool
7812  USART_MODULE_ID index ) ;
7813 //DOM-IGNORE-BEGIN
7814 //DOM-IGNORE-END
7815  // #ifndef _PLIB_USART_H
7816 /******************************************************************************
7817  End of File
7818 */
7819 
7820 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
7821 /* CLOSE_FILE Include File */
7822 
7823 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
7824 /*******************************************************************************
7825  System Services Library Interface Header
7826  Company:
7827  Microchip Technology Inc.
7828  File Name:
7829  system.h
7830  Summary:
7831  Top level common system services library interface header.
7832  Description:
7833  This file is the top level common system services library interface header.
7834  It defines (or includes files that define) the common system service
7835  types, prototypes, and other definitions that are commonly used by MPLAB
7836  Harmony libraries and system services.
7837 
7838  System services provide common functionality that would otherwise need to
7839  be duplicated by multiple other modules or that would force them to
7840  interact in complex and hard to manage ways. System services eliminate
7841  conflicts by controlling access shared resources.
7842  Remarks:
7843  The parent directory to the "system" directory should be added to the
7844  compiler's search path for header files such that the following include
7845  statment will successfully include this file.
7846 
7847 #include "system/system.h"
7848  *******************************************************************************/
7849 //DOM-IGNORE-BEGIN
7850 /*******************************************************************************
7851 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
7852 Microchip licenses to you the right to use, modify, copy and distribute
7853 Software only when embedded on a Microchip microcontroller or digital signal
7854 controller that is integrated into your product or third party product
7855 (pursuant to the sublicense terms in the accompanying license agreement).
7856 You should refer to the license agreement accompanying this Software for
7857 additional information regarding your rights and obligations.
7858 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
7859 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7860 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7861 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7862 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7863 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7864 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7865 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7866 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7867 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7868  *******************************************************************************/
7869 //DOM-IGNORE-END
7870 #ifndef _SYSTEM_H
7871 #define _SYSTEM_H
7872 // *****************************************************************************
7873 // *****************************************************************************
7874 // Section: Included Files
7875 // *****************************************************************************
7876 // *****************************************************************************
7877 #include "system/common/sys_common.h"
7878 #include "system/common/sys_module.h"
7879 // DOM-IGNORE-BEGIN
7880 // DOM-IGNORE-END
7881 //DOM-IGNORE-BEGIN
7882 //DOM-IGNORE-END
7883  // _SYSTEM_H
7884 /*******************************************************************************
7885  End of File
7886 */
7887 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
7888 /* CLOSE_FILE Include File */
7889 
7890 #include "system/int/sys_int.h"
7891 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
7892 /*******************************************************************************
7893  DMA System Service Library Interface Definition
7894  Company:
7895  Microchip Technology Inc.
7896  File Name:
7897  sys_dma.h
7898  Summary:
7899  DMA System Service.
7900  Description:
7901  This file contains the interface definition for the DMA System
7902  Service. It provides a way to interact with the DMA subsystem to
7903  manage the data transfer between different peripherals and/or memory
7904  without intervention from the CPU.
7905 *******************************************************************************/
7906 //DOM-IGNORE-BEGIN
7907 /*******************************************************************************
7908 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7909 Microchip licenses to you the right to use, modify, copy and distribute
7910 Software only when embedded on a Microchip microcontroller or digital signal
7911 controller that is integrated into your product or third party product
7912 (pursuant to the sublicense terms in the accompanying license agreement).
7913 You should refer to the license agreement accompanying this Software for
7914 additional information regarding your rights and obligations.
7915 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7916 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7917 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7918 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7919 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7920 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7921 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7922 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7923 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7924 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7925 *******************************************************************************/
7926 //DOM-IGNORE-END
7927 #ifndef _SYS_DMA_H
7928 #define _SYS_DMA_H
7929 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
7930 /*******************************************************************************
7931  DMA System Service Library Interface Definition
7932  Company:
7933  Microchip Technology Inc.
7934  File Name:
7935  sys_dma_definitions.h
7936  Summary:
7937  DMA System Service data type definitions header.
7938  Description:
7939  This file contains data type definitions header.
7940 *******************************************************************************/
7941 //DOM-IGNORE-BEGIN
7942 /*******************************************************************************
7943 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7944 Microchip licenses to you the right to use, modify, copy and distribute
7945 Software only when embedded on a Microchip microcontroller or digital signal
7946 controller that is integrated into your product or third party product
7947 (pursuant to the sublicense terms in the accompanying license agreement).
7948 You should refer to the license agreement accompanying this Software for
7949 additional information regarding your rights and obligations.
7950 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7951 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7952 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7953 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7954 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7955 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7956 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7957 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7958 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7959 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7960 *******************************************************************************/
7961 //DOM-IGNORE-END
7962 #ifndef _SYS_DMA_DEFINITIONS_H
7963 #define _SYS_DMA_DEFINITIONS_H
7964 // *****************************************************************************
7965 // *****************************************************************************
7966 // Section: File includes
7967 // *****************************************************************************
7968 // *****************************************************************************
7969 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
7970 #include "system/common/sys_common.h"
7971 #include "system/common/sys_module.h"
7972 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
7973 /*******************************************************************************
7974  DMA Peripheral Library Interface Header
7975  Company:
7976  Microchip Technology Inc.
7977  File Name:
7978  plib_dma.h
7979  Summary:
7980  Defines the DMA Peripheral Library interface functions.
7981  Description:
7982  This header file contains the function prototypes and definitions of
7983  the data types and constants that make up the interface to the Direct Memory
7984  Access (DMA) Peripheral Library for Microchip microcontrollers. The
7985  definitions in this file are for the DMA module.
7986 *******************************************************************************/
7987 // DOM-IGNORE-BEGIN
7988 /*******************************************************************************
7989 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
7990 Microchip licenses to you the right to use, modify, copy and distribute
7991 Software only when embedded on a Microchip microcontroller or digital signal
7992 controller that is integrated into your product or third party product
7993 (pursuant to the sublicense terms in the accompanying license agreement).
7994 You should refer to the license agreement accompanying this Software for
7995 additional information regarding your rights and obligations.
7996 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7997 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7998 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7999 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8000 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8001 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8002 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8003 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8004 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8005 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8006 *******************************************************************************/
8007 // DOM-IGNORE-END
8008 #ifndef _PLIB_DMA_H
8009 #define _PLIB_DMA_H
8010 // DOM-IGNORE-BEGIN
8011 // DOM-IGNORE-END
8012 // *****************************************************************************
8013 // *****************************************************************************
8014 // Section: Includes
8015 // *****************************************************************************
8016 // *****************************************************************************
8017 /* See Bottom of file for implementation header include files.
8018 */
8019 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8020 //DOM-IGNORE-BEGIN
8021 /*******************************************************************************
8022 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8023 Microchip licenses to you the right to use, modify, copy and distribute
8024 Software only when embedded on a Microchip microcontroller or digital signal
8025 controller that is integrated into your product or third party product
8026 (pursuant to the sublicense terms in the accompanying license agreement).
8027 You should refer to the license agreement accompanying this Software for
8028 additional information regarding your rights and obligations.
8029 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8030 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8031 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8032 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8033 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8034 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8035 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8036 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8037 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8038 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8039  *******************************************************************************/
8040 //DOM-IGNORE-END
8041 #ifndef _PLIB_DMA_PROCESSOR_H
8042 #define _PLIB_DMA_PROCESSOR_H
8043 #error "Can't find header"
8044 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8045 /* CLOSE_FILE Include File */
8046 
8047 // *****************************************************************************
8048 // *****************************************************************************
8049 // Section: Peripheral Library Interface Functions
8050 // *****************************************************************************
8051 // *****************************************************************************
8052 // *****************************************************************************
8053 // *****************************************************************************
8054 // Section: DMA Channel Status Functions
8055 // *****************************************************************************
8056 // *****************************************************************************
8057 //******************************************************************************
8058 /* Function:
8059  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8060  DMA_CHANNEL channel )
8061  Summary:
8062  Returns the buffered data write status for the specified channel.
8063  Description:
8064  This function returns the buffered data write status for the specified channel.
8065  Precondition:
8066  None.
8067  Parameters:
8068  channel - One of the existing DMA channels listed by DMA_CHANNEL
8069  Returns:
8070  - true - The content of the DMA buffer has not been written to the location
8071  specified in the destination/source address or in Null Write mode
8072  - false - The content of the DMA buffer has been written to the location
8073  specified in the destination/source address or in Null Write mode
8074  Example:
8075  <code>
8076  bool chBuffWriteStatus;
8077  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8078  DMA_CHANNEL_3 );
8079  </code>
8080  Remarks:
8081  This feature is not available on all devices. Please refer to the specific device
8082  data sheet to determine availability.
8083 */
8084 
8085 bool
8087  DMA_MODULE_ID index ,
8088  DMA_CHANNEL channel ) ;
8089 /*******************************************************************************
8090  Function:
8091  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8092  DMA_CHANNEL channel,
8093  DMA_CHANNEL_COLLISION collisonType )
8094  Summary:
8095  Returns the status of the specified collision type for the specified channel.
8096  Description:
8097  This function returns the status of the specified collision type for the
8098  specified channel.
8099  Precondition:
8100  None.
8101  Parameters:
8102  channel - One of the existing DMA channels listed by DMA_CHANNEL
8103  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8104  Returns:
8105  - true - A collision specified by collisonType was detected
8106  - false - No collision of type collisonType was detected
8107  Example:
8108  <code>
8109  bool memWriteCollisionStatus;
8110  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8111  DMA_ID_0,
8112  DMA_CHANNEL_3,
8113  DMA_CHANNEL_COLLISION_MEMORY );
8114  </code>
8115  Remarks:
8116  This feature is not available on all devices. Please refer to the specific
8117  device data sheet to determine availability.
8118 */
8119 
8120 bool
8122  DMA_MODULE_ID index ,
8123  DMA_CHANNEL channel ,
8124  DMA_CHANNEL_COLLISION collisonType ) ;
8125 //******************************************************************************
8126 /* Function:
8127  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8128  DMA_CHANNEL channel )
8129  Summary:
8130  Returns the Ping-Pong mode status for the specified channel.
8131  Description:
8132  This function returns the Ping-Pong mode status for the specified channel.
8133  Precondition:
8134  None.
8135  Parameters:
8136  channel - One of the existing DMA channels listed by DMA_CHANNEL
8137  Returns:
8138  mode - One of the possible Ping-Pong modes
8139  Example:
8140  <code>
8141  DMA_PING_PONG_MODE chPingPongStatus;
8142  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8143  DMA_CHANNEL_3 );
8144  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8145  {
8146  \\Application
8147  }
8148  </code>
8149  Remarks:
8150  This feature is not available on all devices. Please refer to the specific
8151  device data sheet to determine availability.
8152 */
8153 
8154 DMA_PING_PONG_MODE
8156  DMA_MODULE_ID index ,
8157  DMA_CHANNEL channel ) ;
8158 //******************************************************************************
8159 /* Function:
8160  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8161  DMA_CHANNEL channel )
8162  Summary:
8163  Returns the event status on the specified channel.
8164  Description:
8165  This function returns the event status on the specified channel.
8166  Precondition:
8167  None.
8168  Parameters:
8169  channel - One of the possible DMA channels listed by DMA_CHANNEL
8170  Returns:
8171  - true - An event was detected
8172  - false - No events were detected
8173  Example:
8174  <code>
8175  bool channeleventStatus;
8176  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8177  DMA_CHANNEL_2 );
8178  </code>
8179  Remarks:
8180  This function implements an operation of the ChannelXEvent feature.
8181  This feature may not be available on all devices. Please refer to the
8182  specific device data sheet to determine availability or include the
8183  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8184  whether this feature is available.
8185 */
8186 
8187 bool
8189  DMA_MODULE_ID index ,
8190  DMA_CHANNEL channel ) ;
8191 // *****************************************************************************
8192 // *****************************************************************************
8193 // Section: DMA Channel Configuration Functions
8194 // *****************************************************************************
8195 // *****************************************************************************
8196 //******************************************************************************
8197 /* Function:
8198  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8199  DMA_CHANNEL channel,
8200  DMA_CHANNEL_PRIORITY channelPriority )
8201  Summary:
8202  Sets the priority of the specified channel.
8203  Description:
8204  This function sets the priority of the specified channel.
8205  Precondition:
8206  None.
8207  Parameters:
8208  channel - One of the existing DMA channels listed by DMA_CHANNEL
8209  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8210  Returns:
8211  None.
8212  Example:
8213  <code>
8214  DMA_CHANNEL channel = DMA_CHANNEL_0;
8215  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8216  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8217  </code>
8218  Remarks:
8219  This function implements an operation of the ChannelXPriority feature.
8220  This feature may not be available on all devices. Please refer to the
8221  specific device data sheet to determine availability or use the
8222  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8223  whether this feature is available.
8224 */
8225 
8226 void
8228  DMA_MODULE_ID index ,
8229  DMA_CHANNEL channel ,
8230  DMA_CHANNEL_PRIORITY channelPriority ) ;
8231 //******************************************************************************
8232 /* Function:
8233  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8234  DMA_CHANNEL channel )
8235  Summary:
8236  Gets the priority of the specified channel.
8237  Description:
8238  This function gets the priority of the specified channel.
8239  Precondition:
8240  None.
8241  Parameters:
8242  channel - One of the existing DMA channels listed by DMA_CHANNEL
8243  Returns:
8244  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8245  Example:
8246  <code>
8247  DMA_CHANNEL channel = DMA_CHANNEL_0;
8248  DMA_CHANNEL_PRIORITY channelPriority;
8249  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8250  </code>
8251  Remarks:
8252  This function implements an operation of the ChannelXPriority feature.
8253  This feature may not be available on all devices. Please refer to the
8254  specific device data sheet to determine availability or use the
8255  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8256  whether this feature is available.
8257 */
8258 
8259 DMA_CHANNEL_PRIORITY
8261  DMA_MODULE_ID index ,
8262  DMA_CHANNEL channel ) ;
8263 //******************************************************************************
8264 /* Function:
8265  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8266  DMA_CHANNEL_PRIORITY channelPriority )
8267  Summary:
8268  Sets the priority scheme of the DMA channels.
8269  Description:
8270  This function sets the priority scheme of the DMA channels at the global level.
8271  This function is used in devices that do not have the per channel priority feature.
8272  Precondition:
8273  None.
8274  Parameters:
8275  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8276  Returns:
8277  None.
8278  Example:
8279  <code>
8280  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8281  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8282  </code>
8283  Remarks:
8284  This feature is not available on all devices. Please refer to the specific
8285  device data sheet to determine availability.
8286 */
8287 
8288 void
8290  DMA_MODULE_ID index ,
8291  DMA_CHANNEL_PRIORITY channelPriority ) ;
8292 //******************************************************************************
8293 /* Function:
8294  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8295  Summary:
8296  Gets the priority scheme of the DMA channels.
8297  Description:
8298  This function gets the priority scheme of the DMA channels at the global level.
8299  This function is used in devices that do not have the per channel priority feature.
8300  Precondition:
8301  None.
8302  Parameters:
8303  None.
8304  Returns:
8305  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8306  Example:
8307  <code>
8308  DMA_CHANNEL_PRIORITY channelPriority;
8309  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8310  </code>
8311  Remarks:
8312  This feature is not available on all devices. Please refer to the specific
8313  device data sheet to determine availability.
8314 */
8315 
8316 DMA_CHANNEL_PRIORITY
8318  DMA_MODULE_ID index ) ;
8319 //******************************************************************************
8320 /* Function:
8321  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8322  DMA_CHANNEL channel )
8323  Summary:
8324  Channel is continuously enabled.
8325  Description:
8326  This function enables the channel continuously. The channel is not automatically
8327  disabled after a block transfer is complete.
8328  Precondition:
8329  None.
8330  Parameters:
8331  channel - One of the possible DMA channels listed by DMA_CHANNEL
8332  Returns:
8333  None.
8334  Example:
8335  <code>
8336  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8337  </code>
8338  Remarks:
8339  This function implements an operation of the ChannelXAuto feature.
8340  This feature may not be available on all devices. Please refer to the
8341  specific device data sheet to determine availability or use the
8342  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8343  whether this feature is available.
8344 */
8345 
8346 void
8348  DMA_MODULE_ID index ,
8349  DMA_CHANNEL channel ) ;
8350 //******************************************************************************
8351 /* Function:
8352  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8353  DMA_CHANNEL channel )
8354  Summary:
8355  Returns the channel automatic enable status.
8356  Description:
8357  This function returns the channel automatic enable status.
8358  Precondition:
8359  None.
8360  Parameters:
8361  channel - One of the possible DMA channels listed by DMA_CHANNEL
8362  Returns:
8363  - true - Channel automatic enable is on
8364  - false - Channel automatic enable is off
8365  Example:
8366  <code>
8367  bool ChAutoEnableStatus;
8368  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8369  </code>
8370  Remarks:
8371  This function implements an operation of the ChannelXAuto feature.
8372  This feature may not be available on all devices. Please refer to the
8373  specific device data sheet to determine availability or use the
8374  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8375  whether this feature is available.
8376 */
8377 
8378 bool
8380  DMA_MODULE_ID index ,
8381  DMA_CHANNEL channel ) ;
8382 //******************************************************************************
8383 /* Function:
8384  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8385  DMA_CHANNEL channel )
8386  Summary:
8387  Channel is disabled after a block transfer is complete.
8388  Description:
8389  This function disables a channel after a block transfer is complete.
8390  Precondition:
8391  None.
8392  Parameters:
8393  channel - One of the possible DMA channels listed by DMA_CHANNEL
8394  Returns:
8395  None.
8396  Example:
8397  <code>
8398  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8399  </code>
8400  Remarks:
8401  This function implements an operation of the ChannelXAuto feature.
8402  This feature may not be available on all devices. Please refer to the
8403  specific device data sheet to determine availability or use the
8404  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8405  whether this feature is available.
8406 */
8407 
8408 void
8410  DMA_MODULE_ID index ,
8411  DMA_CHANNEL channel ) ;
8412 //******************************************************************************
8413 /* Function:
8414  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8415  DMA_CHANNEL channel )
8416  Summary:
8417  Channel chain feature is enabled.
8418  Description:
8419  This function enables the channel chain feature.
8420  Precondition:
8421  None.
8422  Parameters:
8423  channel - One of the possible DMA channels listed by DMA_CHANNEL
8424  Returns:
8425  None.
8426  Example:
8427  <code>
8428  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8429  </code>
8430  Remarks:
8431  This function implements an operation of the ChannelXChainEnbl feature.
8432  This feature may not be available on all devices. Please refer to the
8433  specific device data sheet to determine availability or use the
8434  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8435  whether this feature is available.
8436 */
8437 
8438 void
8440  DMA_MODULE_ID index ,
8441  DMA_CHANNEL channel ) ;
8442 //******************************************************************************
8443 /* Function:
8444  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8445  DMA_CHANNEL channel )
8446  Summary:
8447  Returns the chain status of the specified channel.
8448  Description:
8449  This function returns the chain status of the specified channel.
8450  Precondition:
8451  None.
8452  Parameters:
8453  channel - One of the possible DMA channels listed by DMA_CHANNEL
8454  Returns:
8455  - true - The channel chain is on for this channel
8456  - false - The channel chain is off for this channel
8457  Example:
8458  <code>
8459  bool ChchainStatus;
8460  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8461  </code>
8462  Remarks:
8463  This function implements an operation of the ChannelXChainEnbl feature.
8464  This feature may not be available on all devices. Please refer to the
8465  specific device data sheet to determine availability or use the
8466  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8467  whether this feature is available.
8468 */
8469 
8470 bool
8472  DMA_MODULE_ID index ,
8473  DMA_CHANNEL channel ) ;
8474 //******************************************************************************
8475 /* Function:
8476  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8477  DMA_CHANNEL channel )
8478  Summary:
8479  Disables the channel chaining for the specified DMA channel.
8480  Description:
8481  This function disables the channel chaining for the specified DMA channel.
8482  Precondition:
8483  None.
8484  Parameters:
8485  channel - One of the possible DMA channels listed by DMA_CHANNEL
8486  Returns:
8487  None.
8488  Example:
8489  <code>
8490  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8491  </code>
8492  Remarks:
8493  This function implements an operation of the ChannelXChainEnbl feature.
8494  This feature may not be available on all devices. Please refer to the
8495  specific device data sheet to determine availability or use the
8496  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8497  whether this feature is available.
8498 */
8499 
8500 void
8502  DMA_MODULE_ID index ,
8503  DMA_CHANNEL channel ) ;
8504 //******************************************************************************
8505 /* Function:
8506  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8507  DMA_CHANNEL channel )
8508  Summary:
8509  Channel start/abort events will be registered even if the channel is
8510  disabled.
8511  Description:
8512  This function will allow the channel register start/abort events even if the
8513  channel is disabled.
8514  Precondition:
8515  None.
8516  Parameters:
8517  channel - One of the possible DMA channels listed by DMA_CHANNEL
8518  Returns:
8519  None.
8520  Example:
8521  <code>
8522  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8523  </code>
8524  Remarks:
8525  This function implements an operation of the ChannelXDisabled feature.
8526  This feature may not be available on all devices. Please refer to the
8527  specific device data sheet to determine availability or use the
8528  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8529  determine whether this feature is available.
8530 */
8531 
8532 void
8534  DMA_MODULE_ID index ,
8535  DMA_CHANNEL channel ) ;
8536 //******************************************************************************
8537 /* Function:
8538  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
8539  DMA_CHANNEL channel )
8540  Summary:
8541  Channel start/abort events will be ignored even if the channel is
8542  disabled.
8543  Description:
8544  This function will allow the channel start/abort events to be ignored even if
8545  the channel is disabled.
8546  Precondition:
8547  None.
8548  Parameters:
8549  channel - One of the possible DMA channels listed by DMA_CHANNEL
8550  Returns:
8551  None.
8552  Example:
8553  <code>
8554  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8555  </code>
8556  Remarks:
8557  This function implements an operation of the ChannelXDisabled feature.
8558  This feature may not be available on all devices. Please refer to the
8559  specific device data sheet to determine availability or use the
8560  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8561  determine whether this feature is available.
8562 */
8563 
8564 void
8566  DMA_MODULE_ID index ,
8567  DMA_CHANNEL channel ) ;
8568 //******************************************************************************
8569 /* Function:
8570  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
8571  DMA_CHANNEL channel )
8572  Summary:
8573  Enable the specified channel.
8574  Description:
8575  This function will enable the specified channel.
8576  Precondition:
8577  None.
8578  Parameters:
8579  channel - One of the possible DMA channels listed by DMA_CHANNEL
8580  Returns:
8581  None.
8582  Example:
8583  <code>
8584  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
8585  </code>
8586  Remarks:
8587  This function implements an operation of the ChannelX feature.
8588  This feature may not be available on all devices. Please refer to the
8589  specific device data sheet to determine availability or use the
8590  PLIB_DMA_ExistsChannelX function in your application to automatically
8591  determine whether this feature is available.
8592 */
8593 
8594 void
8596  DMA_MODULE_ID index ,
8597  DMA_CHANNEL channel ) ;
8598 //******************************************************************************
8599 /* Function:
8600  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
8601  DMA_CHANNEL channel )
8602  Summary:
8603  Return the enable status of the specified channel.
8604  Description:
8605  This function will return the enable status of the specified channel.
8606  Precondition:
8607  None.
8608  Parameters:
8609  channel - One of the possible DMA channels listed by DMA_CHANNEL
8610  Returns:
8611  - true - The specified DMA channel is enabled
8612  - false - The specified DMA channel is disabled
8613  Example:
8614  <code>
8615  bool chEnableStatus;
8616  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
8617  </code>
8618  Remarks:
8619  This function implements an operation of the ChannelX feature.
8620  This feature may not be available on all devices. Please refer to the
8621  specific device data sheet to determine availability or use the
8622  PLIB_DMA_ExistsChannelX function in your application to automatically
8623  determine whether this feature is available.
8624 */
8625 
8626 bool
8628  DMA_MODULE_ID index ,
8629  DMA_CHANNEL channel ) ;
8630 //******************************************************************************
8631 /* Function:
8632  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
8633  DMA_CHANNEL channel )
8634  Summary:
8635  Disable the specified channel.
8636  Description:
8637  This function will disable the specified channel.
8638  Precondition:
8639  None.
8640  Parameters:
8641  channel - One of the possible DMA channels listed by DMA_CHANNEL
8642  Returns:
8643  None.
8644  Example:
8645  <code>
8646  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
8647  </code>
8648  Remarks:
8649  This function implements an operation of the ChannelX feature.
8650  This feature may not be available on all devices. Please refer to the
8651  specific device data sheet to determine availability or use the
8652  PLIB_DMA_ExistsChannelX function in your application to automatically
8653  determine whether this feature is available.
8654 */
8655 
8656 void
8658  DMA_MODULE_ID index ,
8659  DMA_CHANNEL channel ) ;
8660 //******************************************************************************
8661 /* Function:
8662  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
8663  DMA_CHANNEL channel )
8664  Summary:
8665  Chains the specified channel to a channel lower in natural priority.
8666  Description:
8667  This function will chain the specified channel to a channel lower in
8668  natural priority. CH3 will be enabled by a CH4 transfer complete.
8669  Precondition:
8670  None.
8671  Parameters:
8672  channel - One of the possible DMA channels listed by DMA_CHANNEL
8673  Returns:
8674  None.
8675  Example:
8676  <code>
8677  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
8678  </code>
8679  Remarks:
8680  This function implements an operation of the ChannelXChain feature.
8681  This feature may not be available on all devices. Please refer to the
8682  specific device data sheet to determine availability or use the
8683  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8684  determine whether this feature is available.
8685 */
8686 
8687 void
8689  DMA_MODULE_ID index ,
8690  DMA_CHANNEL channel ) ;
8691 //******************************************************************************
8692 /* Function:
8693  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
8694  DMA_CHANNEL channel )
8695  Summary:
8696  Chains the specified channel to a channel higher in natural priority.
8697  Description:
8698  This function will chain the specified channel to a channel higher in
8699  natural priority. CH5 will be enabled by a CH4 transfer complete.
8700  Precondition:
8701  None.
8702  Parameters:
8703  channel - One of the possible DMA channels listed by DMA_CHANNEL
8704  Returns:
8705  None.
8706  Example:
8707  <code>
8708  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
8709  </code>
8710  Remarks:
8711  This function implements an operation of the ChannelXChain feature.
8712  This feature may not be available on all devices. Please refer to the
8713  specific device data sheet to determine availability or use the
8714  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8715  determine whether this feature is available.
8716 */
8717 
8718 void
8720  DMA_MODULE_ID index ,
8721  DMA_CHANNEL channel ) ;
8722 //******************************************************************************
8723 /* Function:
8724  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
8725  DMA_CHANNEL channel )
8726  Summary:
8727  Sets the Busy bit to active.
8728  Description:
8729  This function sets the Busy bit to active, indicating the channel is active
8730  or has been enabled.
8731  Precondition:
8732  None.
8733  Parameters:
8734  channel - One of the possible DMA channels listed by DMA_CHANNEL
8735  Returns:
8736  None.
8737  Example:
8738  <code>
8739  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8740  </code>
8741  Remarks:
8742  This function implements an operation of the ChannelXBusy feature.
8743  This feature may not be available on all devices. Please refer to the
8744  specific device data sheet to determine availability or use the
8745  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8746  determine whether this feature is available.
8747 */
8748 
8749 void
8751  DMA_MODULE_ID index ,
8752  DMA_CHANNEL channel ) ;
8753 //******************************************************************************
8754 /* Function:
8755  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
8756  DMA_CHANNEL channel )
8757  Summary:
8758  Sets the Busy bit to inactive.
8759  Description:
8760  This function sets the Busy bit to inactive, indicating the channel is inactive
8761  or has been disabled.
8762  Precondition:
8763  None.
8764  Parameters:
8765  channel - One of the possible DMA channels listed by DMA_CHANNEL
8766  Returns:
8767  None.
8768  Example:
8769  <code>
8770  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8771  </code>
8772  Remarks:
8773  This function implements an operation of the ChannelXBusy feature.
8774  This feature may not be available on all devices. Please refer to the
8775  specific device data sheet to determine availability or use the
8776  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8777  determine whether this feature is available.
8778 */
8779 
8780 void
8782  DMA_MODULE_ID index ,
8783  DMA_CHANNEL channel ) ;
8784 //******************************************************************************
8785 /* Function:
8786  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
8787  DMA_CHANNEL channel )
8788  Summary:
8789  Returns the busy status of the specified channel.
8790  Description:
8791  This function returns the busy status of the specified channel.
8792  Precondition:
8793  None.
8794  Parameters:
8795  channel - One of the possible DMA channels listed by DMA_CHANNEL
8796  Returns:
8797  - true - The channel is active or has been enabled
8798  - false - The channel is inactive or has been disabled
8799  Example:
8800  <code>
8801  bool chBusyStatus;
8802  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
8803  </code>
8804  Remarks:
8805  This function implements an operation of the ChannelXBusy feature.
8806  This feature may not be available on all devices. Please refer to the
8807  specific device data sheet to determine availability or use the
8808  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8809  determine whether this feature is available.
8810 */
8811 
8812 bool
8814  DMA_MODULE_ID index ,
8815  DMA_CHANNEL channel ) ;
8816 //******************************************************************************
8817 /* Function:
8818  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
8819  DMA_CHANNEL channel,
8820  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
8821  Summary:
8822  Selects the data transfer direction of the specified channel.
8823  Description:
8824  This function selects the data transfer direction of the specified channel.
8825  Precondition:
8826  None.
8827  Parameters:
8828  channel - One of the possible DMA channels listed by DMA_CHANNEL
8829  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
8830  Returns:
8831  None.
8832  Example:
8833  <code>
8834  PLIB_DMA_ChannelXTransferDirectionSelect (
8835  DMA_ID_0,
8836  DMA_CHANNEL_4,
8837  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
8838  </code>
8839  Remarks:
8840  This feature is not available on all devices. Please refer to the specific
8841  device data sheet to determine availability.
8842 */
8843 
8844 void
8846  DMA_MODULE_ID index ,
8847  DMA_CHANNEL channel ,
8848  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
8849 //******************************************************************************
8850 /* Function:
8851  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
8852  DMA_MODULE_ID index,
8853  DMA_CHANNEL channel)
8854  Summary:
8855  Returns the data transfer direction of the specified channel.
8856  Description:
8857  This function returns the data transfer direction of the specified channel.
8858  Precondition:
8859  None.
8860  Parameters:
8861  channel - One of the possible DMA channels listed by DMA_CHANNEL
8862  Returns:
8863  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
8864  DMA_CHANNEL_TRANSFER_DIRECTION
8865  Example:
8866  <code>
8867  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
8868  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
8869  DMA_ID_0,
8870  DMA_CHANNEL_4 );
8871  </code>
8872  Remarks:
8873  This feature is not available on all devices. Please refer to the specific
8874  device data sheet to determine availability.
8875 */
8876 
8877 DMA_CHANNEL_TRANSFER_DIRECTION
8879  DMA_MODULE_ID index ,
8880  DMA_CHANNEL channel ) ;
8881 //******************************************************************************
8882 /* Function:
8883  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
8884  DMA_CHANNEL channel ,
8885  uint16_t address,
8886  DMA_ADDRESS_OFFSET_TYPE offset )
8887  Summary:
8888  Sets the primary/secondary start address (DPSRAM) offset to the value
8889  specified depending on the offset type specified for the specified channel.
8890  Description:
8891  This function sets the primary/secondary start address (DPSRAM) offset to the value
8892  specified depending on the offset type specified for the specified channel.
8893  Precondition:
8894  None.
8895  Parameters:
8896  channel - One of the possible DMA channels listed by DMA_CHANNEL
8897  address - The primary/secondary DPSRAM start address offset
8898  offset - The type of the address offset (primary/secondary)
8899  Returns:
8900  None.
8901  Example:
8902  <code>
8903  uint16_t address = 0x100;
8904  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
8905  DMA_CHANNEL_4,
8906  address,
8907  DMA_ADDRESS_OFFSET_PRIMARY );
8908  </code>
8909  Remarks:
8910  This feature is not available on all devices. Please refer to the specific
8911  device data sheet to determine availability.
8912 */
8913 
8914 void
8916  DMA_MODULE_ID index ,
8917  DMA_CHANNEL channel ,
8918  uint16_t address ,
8919  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8920 //******************************************************************************
8921 /* Function:
8922  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
8923  DMA_CHANNEL channel,
8924  DMA_ADDRESS_OFFSET_TYPE offset)
8925  Summary:
8926  Gets the primary/secondary start address (DPSRAM) offset.
8927  Description:
8928  This function gets the primary/secondary start address (DPSRAM) offset.
8929  Precondition:
8930  None.
8931  Parameters:
8932  channel - One of the possible DMA channels listed by DMA_CHANNEL
8933  offset - The type of the address offset (primary/secondary)
8934  Returns:
8935  - uint16_t - The primary/secondary DPSRAM start address offset
8936  Example:
8937  <code>
8938  uint16_t addressOffsetA;
8939  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
8940  DMA_ID_0,
8941  DMA_CHANNEL_4,
8942  address,
8943  DMA_ADDRESS_OFFSET_PRIMARY );
8944  </code>
8945  Remarks:
8946  This feature is not available on all devices. Please refer to the specific
8947  device data sheet to determine availability.
8948 */
8949 
8950 uint16_t
8952  DMA_MODULE_ID index ,
8953  DMA_CHANNEL channel ,
8954  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8955 //******************************************************************************
8956 /* Function:
8957  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
8958  DMA_CHANNEL channel ,
8959  uint16_t peripheraladdress )
8960  Summary:
8961  Sets the peripheral address for the specified channel.
8962  Description:
8963  This function sets the peripheral address for the specified channel.
8964  Precondition:
8965  None.
8966  Parameters:
8967  channel - One of the possible DMA channels listed by DMA_CHANNEL
8968  peripheraladdress - The peripheral address for the specified channel
8969  Returns:
8970  None.
8971  Example:
8972  <code>
8973  uint16_t peripheraladdress = 0x100;
8974  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
8975  DMA_CHANNEL_4,
8976  peripheraladdress );
8977  </code>
8978  Remarks:
8979  This feature is not available on all devices. Please refer to the specific
8980  device data sheet to determine availability.
8981 */
8982 
8983 void
8985  DMA_MODULE_ID index ,
8986  DMA_CHANNEL channel ,
8987  uint16_t peripheraladdress ) ;
8988 //******************************************************************************
8989 /* Function:
8990  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
8991  DMA_CHANNEL channel )
8992  Summary:
8993  Gets the peripheral address configured for the specified channel.
8994  Description:
8995  This function gets the peripheral address configured for the specified channel.
8996  Precondition:
8997  None.
8998  Parameters:
8999  channel - One of the possible DMA channels listed by DMA_CHANNEL
9000  Returns:
9001  - uint16_t - The peripheral address configured for the specified channel
9002  Example:
9003  <code>
9004  uint16_t peripheraladdress;
9005  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9006  DMA_CHANNEL_4 );
9007  </code>
9008  Remarks:
9009  This feature is not available on all devices. Please refer to the specific
9010  device data sheet to determine availability.
9011 */
9012 
9013 uint16_t
9015  DMA_MODULE_ID index ,
9016  DMA_CHANNEL channel ) ;
9017 //******************************************************************************
9018 /* Function:
9019  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9020  DMA_CHANNEL channel ,
9021  uint16_t transferCount )
9022  Summary:
9023  Sets the DMA data transfer count for the specified channel.
9024  Description:
9025  This function sets the DMA data transfer count for the specified channel.
9026  Precondition:
9027  None.
9028  Parameters:
9029  channel - One of the possible DMA channels listed by DMA_CHANNEL
9030  transferCount - The DMA transfer count for the channel
9031  Returns:
9032  None.
9033  Example:
9034  <code>
9035  uint16_t transferCount = 0x10;
9036  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9037  DMA_CHANNEL_4,
9038  transferCount );
9039  </code>
9040  Remarks:
9041  This feature is not available on all devices. Please refer to the specific
9042  device data sheet to determine availability.
9043 */
9044 
9045 void
9047  DMA_MODULE_ID index ,
9048  DMA_CHANNEL channel ,
9049  uint16_t transferCount ) ;
9050 //******************************************************************************
9051 /* Function:
9052  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9053  DMA_CHANNEL channel )
9054  Summary:
9055  Gets the DMA data transfer count that is programmed for the specified channel.
9056  Description:
9057  This function gets the DMA data transfer count that is programmed for the specified channel.
9058  Precondition:
9059  None.
9060  Parameters:
9061  channel - One of the possible DMA channels listed by DMA_CHANNEL
9062  Returns:
9063  - uint16_t - The DMA transfer count for the channel
9064  Example:
9065  <code>
9066  uint16_t transferCount;
9067  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9068  DMA_CHANNEL_4 );
9069  </code>
9070  Remarks:
9071  This feature is not available on all devices. Please refer to the specific
9072  device data sheet to determine availability.
9073 */
9074 
9075 uint16_t
9077  DMA_MODULE_ID index ,
9078  DMA_CHANNEL channel ) ;
9079 //******************************************************************************
9080 /* Function:
9081  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9082  DMA_MODULE_ID index,
9083  DMA_CHANNEL channel,
9084  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9085  Summary:
9086  Sets the source address mode of the specified channel.
9087  Description:
9088  This function sets the source address mode of the specified channel.
9089  Precondition:
9090  None.
9091  Parameters:
9092  channel - One of the possible DMA channels listed by DMA_CHANNEL
9093  sourceAddressMode - One of the possible source addressing modes listed by
9094  DMA_SOURCE_ADDRESSING_MODE
9095  Returns:
9096  None.
9097  Example:
9098  <code>
9099  PLIB_DMA_ChannelXSourceAddressModeSelect (
9100  DMA_ID_0,
9101  DMA_CHANNEL_4,
9102  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9103  </code>
9104  Remarks:
9105  This feature is not available on all devices. Please refer to the specific
9106  device data sheet to determine availability.
9107 */
9108 
9109 void
9111  DMA_MODULE_ID index ,
9112  DMA_CHANNEL channel ,
9113  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9114 //******************************************************************************
9115 /* Function:
9116  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9117  DMA_MODULE_ID index,
9118  DMA_CHANNEL channel )
9119  Summary:
9120  Gets the source address mode of the specified channel.
9121  Description:
9122  This function gets the source address mode of the specified channel.
9123  Precondition:
9124  None.
9125  Parameters:
9126  channel - One of the possible DMA channels listed by DMA_CHANNEL
9127  Returns:
9128  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9129  listed by DMA_SOURCE_ADDRESSING_MODE
9130  Example:
9131  <code>
9132  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9133  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9134  DMA_CHANNEL_4 );
9135  </code>
9136  Remarks:
9137  This feature is not available on all devices. Please refer to the specific
9138  device data sheet to determine availability.
9139 */
9140 
9141 DMA_SOURCE_ADDRESSING_MODE
9143  DMA_MODULE_ID index ,
9144  DMA_CHANNEL channel ) ;
9145 //******************************************************************************
9146 /* Function:
9147  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9148  DMA_MODULE_ID index,
9149  DMA_CHANNEL channel,
9150  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9151  Summary:
9152  Sets the source address mode of the specified channel.
9153  Description:
9154  This function Sets the source address mode of the specified channel.
9155  Precondition:
9156  None.
9157  Parameters:
9158  channel - One of the possible DMA channels listed by DMA_CHANNEL
9159  destinationAddressMode - One of the possible source addressing modes listed by
9160  DMA_DESTINATION_ADDRESSING_MODE
9161  Returns:
9162  None.
9163  Example:
9164  <code>
9165  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9166  DMA_ID_0,
9167  DMA_CHANNEL_4,
9168  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9169  </code>
9170  Remarks:
9171  This feature is not available on all devices. Please refer to the specific
9172  device data sheet to determine availability.
9173 */
9174 
9175 void
9177  DMA_MODULE_ID index ,
9178  DMA_CHANNEL channel ,
9179  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9180 //******************************************************************************
9181 /* Function:
9182  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9183  DMA_MODULE_ID index,
9184  DMA_CHANNEL channel )
9185  Summary:
9186  Gets the source address mode of the specified channel.
9187  Description:
9188  This function gets the source address mode of the specified channel.
9189  Precondition:
9190  None.
9191  Parameters:
9192  channel - One of the possible DMA channels listed by DMA_CHANNEL
9193  Returns:
9194  - destinationAddressMode - One of the possible source addressing modes listed by
9195  DMA_DESTINATION_ADDRESSING_MODE
9196  Example:
9197  <code>
9198  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9199  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9200  DMA_ID_0,
9201  DMA_CHANNEL_4 );
9202  </code>
9203  Remarks:
9204  This feature is not available on all devices. Please refer to the specific
9205  device data sheet to determine availability.
9206 */
9207 
9208 DMA_DESTINATION_ADDRESSING_MODE
9210  DMA_MODULE_ID index ,
9211  DMA_CHANNEL channel ) ;
9212 //******************************************************************************
9213 /* Function:
9214  void PLIB_DMA_ChannelXAddressModeSelect (
9215  DMA_MODULE_ID index,
9216  DMA_CHANNEL channel,
9217  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9218  Summary:
9219  Sets the channel address mode.
9220  Description:
9221  This function sets the channel address mode.
9222  Precondition:
9223  None.
9224  Parameters:
9225  channel - One of the possible DMA channels listed by DMA_CHANNEL
9226  channelAddressMode - One of the possible channel addressing modes listed by
9227  DMA_CHANNEL_ADDRESSING_MODE
9228  Returns:
9229  None.
9230  Example:
9231  <code>
9232  PLIB_DMA_ChannelXAddressModeSelect (
9233  DMA_ID_0,
9234  DMA_CHANNEL_4,
9235  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9236  </code>
9237  Remarks:
9238  This feature is not available on all devices. Please refer to the specific
9239  device data sheet to determine availability.
9240 */
9241 
9242 void
9244  DMA_MODULE_ID index ,
9245  DMA_CHANNEL channel ,
9246  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9247 //******************************************************************************
9248 /* Function:
9249  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9250  DMA_MODULE_ID index,
9251  DMA_CHANNEL channel )
9252  Summary:
9253  Gets the channel address mode.
9254  Description:
9255  This function gets the channel address mode.
9256  Precondition:
9257  None.
9258  Parameters:
9259  channel - One of the possible DMA channels listed by DMA_CHANNEL
9260  Returns:
9261  - channelAddressMode - One of the possible source addressing modes listed by
9262  DMA_CHANNEL_ADDRESSING_MODE
9263  Example:
9264  <code>
9265  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9266  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9267  DMA_CHANNEL_4 );
9268  </code>
9269  Remarks:
9270  This feature is not available on all devices. Please refer to the specific
9271  device data sheet to determine availability.
9272 */
9273 
9274 DMA_CHANNEL_ADDRESSING_MODE
9276  DMA_MODULE_ID index ,
9277  DMA_CHANNEL channel ) ;
9278 // *****************************************************************************
9279 // *****************************************************************************
9280 // Section: DMA Channel Event Configuration functions
9281 // *****************************************************************************
9282 // *****************************************************************************
9283 //******************************************************************************
9284 /* Function:
9285  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9286  DMA_CHANNEL channel,
9287  DMA_CHANNEL_TRIGGER_TYPE trigger )
9288  Summary:
9289  Enables the specified DMA channel trigger.
9290  Description:
9291  This function enables the specified DMA channel trigger.
9292  Precondition:
9293  None.
9294  Parameters:
9295  channel - One of the possible DMA channels listed by DMA_CHANNEL
9296  trigger - Type of trigger (transfer start/abort/pattern match abort)
9297  Returns:
9298  None.
9299  Example:
9300  <code>
9301  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9302  DMA_CHANNEL_4,
9303  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9304  </code>
9305  Remarks:
9306  This function implements an operation of the ChannelXTrigger feature.
9307  This feature may not be available on all devices. Please refer to the
9308  specific device data sheet to determine availability or use the
9309  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9310  determine whether this feature is available.
9311 */
9312 
9313 void
9315  DMA_MODULE_ID index ,
9316  DMA_CHANNEL channel ,
9317  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9318 //******************************************************************************
9319 /* Function:
9320  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9321  DMA_CHANNEL channel,
9322  DMA_CHANNEL_TRIGGER_TYPE trigger )
9323  Summary:
9324  Returns the enable status of the specified DMA transfer/abort trigger.
9325  Description:
9326  This function returns the enable status of the specified DMA transfer/abort trigger.
9327  Precondition:
9328  None.
9329  Parameters:
9330  channel - One of the possible DMA channels listed by DMA_CHANNEL
9331  trigger - Type of trigger (transfer start/abort/pattern match abort)
9332  Returns:
9333  - true - The specified trigger is enabled
9334  - false - The specified trigger is disabled
9335  Example:
9336  <code>
9337  bool startTriggerstatus;
9338  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9339  DMA_ID_0,
9340  DMA_CHANNEL_4,
9341  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9342  </code>
9343  Remarks:
9344  This function implements an operation of the ChannelXTrigger feature.
9345  This feature may not be available on all devices. Please refer to the
9346  specific device data sheet to determine availability or use the
9347  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9348  determine whether this feature is available.
9349 */
9350 
9351 bool
9353  DMA_MODULE_ID index ,
9354  DMA_CHANNEL channel ,
9355  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9356 //******************************************************************************
9357 /* Function:
9358  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9359  DMA_CHANNEL channel,
9360  DMA_CHANNEL_TRIGGER_TYPE trigger )
9361  Summary:
9362  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9363  Description:
9364  This function disables the DMA transfer abort via a matching interrupt
9365  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9366  a transfer.
9367  Precondition:
9368  None.
9369  Parameters:
9370  channel - One of the possible DMA channels listed by DMA_CHANNEL
9371  trigger - Type of trigger (transfer start/abort/pattern match abort)
9372  Returns:
9373  None.
9374  Example:
9375  <code>
9376  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9377  DMA_CHANNEL_4,
9378  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9379  </code>
9380  Remarks:
9381  This function implements an operation of the ChannelXTrigger feature.
9382  This feature may not be available on all devices. Please refer to the
9383  specific device data sheet to determine availability or use the
9384  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9385  determine whether this feature is available.
9386 */
9387 
9388 void
9390  DMA_MODULE_ID index ,
9391  DMA_CHANNEL channel ,
9392  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9393 //******************************************************************************
9394 /* Function:
9395  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9396  DMA_CHANNEL channel)
9397  Summary:
9398  Gets the source number for the DMA channel interrupts.
9399  Description:
9400  This function returns the interrupt source number for the specified
9401  DMA channel.
9402  Precondition:
9403  None.
9404  Parameters:
9405  channel - One of the possible DMA channels listed by DMA_CHANNEL
9406  Returns:
9407  None.
9408  Example:
9409  <code>
9410  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9411  DMA_CHANNEL_4);
9412  </code>
9413  Remarks:
9414  This function implements an operation of the ChannelXTrigger feature.
9415  This feature may not be available on all devices. Please refer to the
9416  specific device data sheet to determine availability or use the
9417  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9418  determine whether this feature is available.
9419 */
9420 
9421 DMA_CHANNEL_INT_SOURCE
9423  DMA_MODULE_ID index ,
9424  DMA_CHANNEL channel ) ;
9425 //******************************************************************************
9426 /* Function:
9427  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9428  DMA_CHANNEL channel,
9429  DMA_TRIGGER_SOURCE IRQnum )
9430  Summary:
9431  Sets the IRQ to initiate the DMA transfer on the specified channel.
9432  Description:
9433  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9434  (IRQ to start the channel transfer.)
9435  Precondition:
9436  None.
9437  Parameters:
9438  channel - One of the possible DMA channels listed by DMA_CHANNEL
9439  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9440  Returns:
9441  None.
9442  Example:
9443  <code>
9444  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9445  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9446  DMA_CHANNEL_4,
9447  irq );
9448  </code>
9449  Remarks:
9450  This function implements an operation of the ChannelXStartIRQ feature.
9451  This feature may not be available on all devices. Please refer to the
9452  specific device data sheet to determine availability or use the
9453  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9454  determine whether this feature is available.
9455 */
9456 
9457 void
9459  DMA_MODULE_ID index ,
9460  DMA_CHANNEL channel ,
9461  DMA_TRIGGER_SOURCE IRQnum ) ;
9462 //******************************************************************************
9463 /* Function:
9464  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9465  DMA_CHANNEL channel,
9466  DMA_TRIGGER_SOURCE IRQ )
9467  Summary:
9468  Sets the IRQ to abort the DMA transfer on the specified channel.
9469  Description:
9470  This function sets the IRQ to abort the DMA transfer on the specified channel.
9471  (IRQ to start the channel transfer.)
9472  Precondition:
9473  None.
9474  Parameters:
9475  channel - One of the possible DMA channels listed by DMA_CHANNEL
9476  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9477  Returns:
9478  None.
9479  Example:
9480  <code>
9481  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9482  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9483  DMA_CHANNEL_4,
9484  irq );
9485  </code>
9486  Remarks:
9487  This function implements an operation of the ChannelXAbortIRQ feature.
9488  This feature may not be available on all devices. Please refer to the
9489  specific device data sheet to determine availability or use the
9490  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9491  determine whether this feature is available.
9492 */
9493 
9494 void
9496  DMA_MODULE_ID index ,
9497  DMA_CHANNEL channel ,
9498  DMA_TRIGGER_SOURCE IRQ ) ;
9499 //******************************************************************************
9500 /* Function:
9501  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9502  DMA_CHANNEL channel,
9503  DMA_CHANNEL_DATA_SIZE channelDataSize )
9504  Summary:
9505  Selects the data size for the specified channel.
9506  Description:
9507  This function selects the data size for the specified channel.
9508  Precondition:
9509  None.
9510  Parameters:
9511  channel - One of the possible DMA channels listed by DMA_CHANNEL
9512  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9513  Returns:
9514  None.
9515  Example:
9516  <code>
9517  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9518  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9519  DMA_CHANNEL_4,
9520  channelDataSize );
9521  </code>
9522  Remarks:
9523  This feature is not available on all devices. Please refer to the specific
9524  device data sheet to determine availability.
9525 */
9526 
9527 void
9529  DMA_MODULE_ID index ,
9530  DMA_CHANNEL channel ,
9531  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
9532 //******************************************************************************
9533 /* Function:
9534  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
9535  DMA_CHANNEL channel )
9536  Summary:
9537  Returns the current data size for the specified channel.
9538  Description:
9539  This function returns the current data size for the specified channel.
9540  Precondition:
9541  None.
9542  Parameters:
9543  channel - One of the possible DMA channels listed by DMA_CHANNEL
9544  Returns:
9545  - channelDataSize - One of the possible data sizes listed by
9546  DMA_CHANNEL_DATA_SIZE
9547  Example:
9548  <code>
9549  DMA_CHANNEL_DATA_SIZE channelDataSize;
9550  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
9551  DMA_CHANNEL_4 );
9552  </code>
9553  Remarks:
9554  This feature is not available on all devices. Please refer to the specific
9555  device data sheet to determine availability.
9556 */
9557 
9558 DMA_CHANNEL_DATA_SIZE
9560  DMA_MODULE_ID index ,
9561  DMA_CHANNEL channel ) ;
9562 //******************************************************************************
9563 /* Function:
9564  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
9565  DMA_MODULE_ID index,
9566  DMA_CHANNEL channel,
9567  DMA_TRANSFER_MODE channeltransferMode )
9568  Summary:
9569  Selects the transfer/operating mode for the specified channel.
9570  Description:
9571  This function selects the transfer/operating mode for the specified channel.
9572  (Transfer mode and operating mode are used interchangeably.)
9573  Precondition:
9574  None.
9575  Parameters:
9576  channel - One of the possible DMA channels listed by DMA_CHANNEL
9577  channeltransferMode - One of the possible operating/transfer modes listed by
9578  DMA_TRANSFER_MODE
9579  Returns:
9580  None.
9581  Example:
9582  <code>
9583  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
9584  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
9585  DMA_CHANNEL_4,
9586  channeltransferMode );
9587  </code>
9588  Remarks:
9589  This feature is not available on all devices. Please refer to the specific
9590  device data sheet to determine availability.
9591 */
9592 
9593 void
9595  DMA_MODULE_ID index ,
9596  DMA_CHANNEL channel ,
9597  DMA_TRANSFER_MODE channeltransferMode ) ;
9598 //******************************************************************************
9599 /* Function:
9600  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
9601  DMA_MODULE_ID index,
9602  DMA_CHANNEL channel )
9603  Summary:
9604  Returns the current transfer/operating mode for the specified channel.
9605  Description:
9606  This function returns the current transfer/operating mode for the specified channel.
9607  (Transfer mode and operating mode are used interchangeably.)
9608  Precondition:
9609  None.
9610  Parameters:
9611  channel - One of the possible DMA channels listed by DMA_CHANNEL
9612  Returns:
9613  - channeltransferMode - One of the possible operating/transfer modes listed
9614  by DMA_TRANSFER_MODE
9615  Example:
9616  <code>
9617  DMA_TRANSFER_MODE channeltransferMode;
9618  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
9619  DMA_ID_0,
9620  DMA_CHANNEL_4 );
9621  </code>
9622  Remarks:
9623  This feature is not available on all devices. Please refer to the specific
9624  device data sheet to determine availability.
9625 */
9626 
9627 DMA_TRANSFER_MODE
9629  DMA_MODULE_ID index ,
9630  DMA_CHANNEL channel ) ;
9631 //******************************************************************************
9632 /* Function:
9633  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
9634  DMA_CHANNEL channel )
9635  Summary:
9636  Enables reloading of the address and count registers.
9637  Description:
9638  This function enables reloading of the address and count registers. The source,
9639  destination address, and the DMA count registers are reloaded to their previous
9640  values upon the start of the next operation.
9641  Precondition:
9642  None.
9643  Parameters:
9644  channel - One of the possible DMA channels listed by DMA_CHANNEL
9645  Returns:
9646  None.
9647  Example:
9648  <code>
9649  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
9650  DMA_CHANNEL_4 );
9651  </code>
9652  Remarks:
9653  This feature is not available on all devices. Please refer to the specific
9654  device data sheet to determine availability.
9655 */
9656 
9657 void
9659  DMA_MODULE_ID index ,
9660  DMA_CHANNEL channel ) ;
9661 //******************************************************************************
9662 /* Function:
9663  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
9664  DMA_CHANNEL channel )
9665  Summary:
9666  Returns the address and count registers reload enable status.
9667  Description:
9668  This function returns the address and count registers reload enable status.
9669  Precondition:
9670  None.
9671  Parameters:
9672  channel - One of the possible DMA channels listed by DMA_CHANNEL
9673  Returns:
9674  - true - The address and count registers reload is enabled
9675  - false - The address and count registers reload is disabled
9676  Example:
9677  <code>
9678  bool chAddressCountReloadStatus;
9679  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
9680  DMA_ID_0,
9681  DMA_CHANNEL_4 );
9682  </code>
9683  Remarks:
9684  This feature is not available on all devices. Please refer to the specific
9685  device data sheet to determine availability.
9686 */
9687 
9688 bool
9690  DMA_MODULE_ID index ,
9691  DMA_CHANNEL channel ) ;
9692 //******************************************************************************
9693 /* Function:
9694  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
9695  DMA_CHANNEL channel )
9696  Summary:
9697  Disables reloading of the address and count registers.
9698  Description:
9699  This function disables reloading of the address and count registers. The source, destination
9700  address, and the DMA count registers are not reloaded to their previous values upon
9701  the start of the next operation.
9702  Precondition:
9703  None.
9704  Parameters:
9705  channel - One of the possible DMA channels listed by DMA_CHANNEL
9706  Returns:
9707  None.
9708  Example:
9709  <code>
9710  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
9711  DMA_CHANNEL_4 );
9712  </code>
9713  Remarks:
9714  This feature is not available on all devices. Please refer to the specific
9715  device data sheet to determine availability.
9716 */
9717 
9718 void
9720  DMA_MODULE_ID index ,
9721  DMA_CHANNEL channel ) ;
9722 //******************************************************************************
9723 /* Function:
9724  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
9725  DMA_CHANNEL channel )
9726  Summary:
9727  Enables the Null Write mode.
9728  Description:
9729  This function enables the Null Write mode. A dummy write is initiated to the
9730  source address for every write to the destination address.
9731  Precondition:
9732  None.
9733  Parameters:
9734  channel - One of the possible DMA channels listed by DMA_CHANNEL
9735  Returns:
9736  None.
9737  Example:
9738  <code>
9739  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
9740  DMA_CHANNEL_4 );
9741  </code>
9742  Remarks:
9743  This feature is not available on all devices. Please refer to the specific
9744  device data sheet to determine availability.
9745 */
9746 
9747 void
9749  DMA_MODULE_ID index ,
9750  DMA_CHANNEL channel ) ;
9751 //******************************************************************************
9752 /* Function:
9753  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
9754  DMA_CHANNEL channel )
9755  Summary:
9756  Returns the enable status of the Null Write mode for the specified channel.
9757  Description:
9758  This function returns the enable status of the Null Write mode for the specified channel.
9759  Precondition:
9760  None.
9761  Parameters:
9762  channel - One of the possible DMA channels listed by DMA_CHANNEL
9763  Returns:
9764  - true - Null write mode is enabled for this channel
9765  - false - Null write mode is disabled for this channel
9766  Example:
9767  <code>
9768  bool chNullWriteStatus;
9769  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
9770  DMA_ID_0,
9771  DMA_CHANNEL_4 );
9772  </code>
9773  Remarks:
9774  This feature is not available on all devices. Please refer to the specific
9775  device data sheet to determine availability.
9776 */
9777 
9778 bool
9780  DMA_MODULE_ID index ,
9781  DMA_CHANNEL channel ) ;
9782 //******************************************************************************
9783 /* Function:
9784  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
9785  DMA_CHANNEL channel )
9786  Summary:
9787  Disables the Null Write mode.
9788  Description:
9789  This function disables the Null Write mode. No dummy write is initiated.
9790  Precondition:
9791  None.
9792  Parameters:
9793  channel - One of the possible DMA channels listed by DMA_CHANNEL
9794  Returns:
9795  None.
9796  Example:
9797  <code>
9798  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
9799  DMA_CHANNEL_4 );
9800  </code>
9801  Remarks:
9802  This feature is not available on all devices. Please refer to the specific
9803  device data sheet to determine availability.
9804 */
9805 
9806 void
9808  DMA_MODULE_ID index ,
9809  DMA_CHANNEL channel ) ;
9810 // *****************************************************************************
9811 // *****************************************************************************
9812 // Section: DMA start/end functions
9813 // *****************************************************************************
9814 // *****************************************************************************
9815 //******************************************************************************
9816 /* Function:
9817  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
9818  DMA_CHANNEL channel )
9819  Summary:
9820  Initiates transfer on the specified channel.
9821  Description:
9822  This function initiates transfer on the specified channel. This is a forced transfer
9823  controlled via software.
9824  Precondition:
9825  None.
9826  Parameters:
9827  channel - One of the possible DMA channels listed by DMA_CHANNEL
9828  Returns:
9829  None.
9830  Example:
9831  <code>
9832  PLIB_DMA_StartTransferSet ( DMA_ID_0,
9833  DMA_CHANNEL_4 );
9834  </code>
9835  Remarks:
9836  This function implements an operation of the StartTransfer feature.
9837  This feature may not be available on all devices. Please refer to the
9838  specific device data sheet to determine availability or use the
9839  PLIB_DMA_ExistsStartTransfer function in your application to automatically
9840  determine whether this feature is available.
9841 */
9842 
9843 void
9845  DMA_MODULE_ID index ,
9846  DMA_CHANNEL channel ) ;
9847 //******************************************************************************
9848 /* Function:
9849  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
9850  DMA_CHANNEL channel )
9851  Summary:
9852  Aborts transfer on the specified channel.
9853  Description:
9854  This function aborts transfer on the specified channel. This is a forced abort
9855  controlled via software.
9856  Precondition:
9857  None.
9858  Parameters:
9859  channel - One of the possible DMA channels listed by DMA_CHANNEL
9860  Returns:
9861  None.
9862  Example:
9863  <code>
9864  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
9865  DMA_CHANNEL_4 );
9866  </code>
9867  Remarks:
9868  This function implements an operation of the AbortTransfer feature.
9869  This feature may not be available on all devices. Please refer to the
9870  specific device data sheet to determine availability or use the
9871  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
9872  determine whether this feature is available.
9873 */
9874 
9875 void
9877  DMA_MODULE_ID index ,
9878  DMA_CHANNEL channel ) ;
9879 // *****************************************************************************
9880 // *****************************************************************************
9881 // Section: DMA General Configuration functions
9882 // *****************************************************************************
9883 // *****************************************************************************
9884 //******************************************************************************
9885 /* Function:
9886  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
9887  Summary:
9888  Sets the BUSY bit of the DMA controller.
9889  Description:
9890  This function sets the BUSY bit of the DMA controller. The DMA module is active.
9891  Precondition:
9892  None.
9893  Parameters:
9894  None.
9895  Returns:
9896  None.
9897  Example:
9898  <code>
9899  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
9900  </code>
9901  Remarks:
9902  This function implements an operation of the Busy feature.
9903  This feature may not be available on all devices. Please refer to the
9904  specific device data sheet to determine availability or use the
9905  PLIB_DMA_ExistsBusy function in your application to automatically
9906  determine whether this feature is available.
9907 */
9908 
9909 void
9911  DMA_MODULE_ID index ) ;
9912 //******************************************************************************
9913 /* Function:
9914  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
9915  Summary:
9916  Resets the BUSY bit of the DMA controller.
9917  Description:
9918  This function resets the BUSY bit of the DMA controller. The DMA module is
9919  disabled and is not actively transferring data.
9920  Precondition:
9921  None.
9922  Parameters:
9923  None.
9924  Returns:
9925  None.
9926  Example:
9927  <code>
9928  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
9929  </code>
9930  Remarks:
9931  This function implements an operation of the Busy feature.
9932  This feature may not be available on all devices. Please refer to the
9933  specific device data sheet to determine availability or use the
9934  PLIB_DMA_ExistsBusy function in your application to automatically
9935  determine whether this feature is available.
9936 */
9937 
9938 void
9940  DMA_MODULE_ID index ) ;
9941 //******************************************************************************
9942 /* Function:
9943  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
9944  Summary:
9945  Gets the BUSY bit of the DMA controller.
9946  Description:
9947  This function gets the BUSY bit of the DMA controller.
9948  Precondition:
9949  None.
9950  Parameters:
9951  None.
9952  Returns:
9953  - true - DMA module is active
9954  - false - DMA module is disabled and is not actively transferring data
9955  Example:
9956  <code>
9957  bool dmaBusyStatus;
9958  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
9959  </code>
9960  Remarks:
9961  This function implements an operation of the Busy feature.
9962  This feature may not be available on all devices. Please refer to the
9963  specific device data sheet to determine availability or use the
9964  PLIB_DMA_ExistsBusy function in your application to automatically
9965  determine whether this feature is available.
9966 */
9967 
9968 bool
9969  PLIB_DMA_IsBusy (
9970  DMA_MODULE_ID index ) ;
9971 //******************************************************************************
9972 /* Function:
9973  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
9974  Summary:
9975  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
9976  Description:
9977  This function suspends the DMA transfers to allow uninterrupted access
9978  by the CPU to the data bus.
9979  Precondition:
9980  None.
9981  Parameters:
9982  None.
9983  Returns:
9984  None.
9985  Example:
9986  <code>
9987  PLIB_DMA_SuspendEnable( DMA_ID_0 );
9988  </code>
9989  Remarks:
9990  This function implements an operation of the Suspend feature.
9991  This feature may not be available on all devices. Please refer to the
9992  specific device data sheet to determine availability or use the
9993  PLIB_DMA_ExistsSuspend function in your application to automatically
9994  determine whether this feature is available.
9995 */
9996 
9997 void
9999  DMA_MODULE_ID index ) ;
10000 //******************************************************************************
10001 /* Function:
10002  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10003  Summary:
10004  DMA suspend is disabled and the DMA module operates normally.
10005  Description:
10006  This function disables the DMA suspend. The DMA module continues to operate
10007  normally.
10008  Precondition:
10009  None.
10010  Parameters:
10011  None.
10012  Returns:
10013  None.
10014  Example:
10015  <code>
10016  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10017  </code>
10018  Remarks:
10019  This function implements an operation of the Suspend feature.
10020  This feature may not be available on all devices. Please refer to the
10021  specific device data sheet to determine availability or use the
10022  PLIB_DMA_ExistsSuspend function in your application to automatically
10023  determine whether this feature is available.
10024 */
10025 
10026 void
10028  DMA_MODULE_ID index ) ;
10029 //******************************************************************************
10030 /* Function:
10031  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10032  Summary:
10033  Returns the DMA suspend status.
10034  Description:
10035  This function returns the DMA suspend status.
10036  Precondition:
10037  None.
10038  Parameters:
10039  None.
10040  Returns:
10041  - true - The DMA transfers are suspended
10042  - false - The DMA operates normally
10043  Example:
10044  <code>
10045  bool dmaSuspendStatus;
10046  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10047  </code>
10048  Remarks:
10049  This function implements an operation of the Suspend feature.
10050  This feature may not be available on all devices. Please refer to the
10051  specific device data sheet to determine availability or use the
10052  PLIB_DMA_ExistsSuspend function in your application to automatically
10053  determine whether this feature is available.
10054 */
10055 
10056 bool
10058  DMA_MODULE_ID index ) ;
10059 //******************************************************************************
10060 /* Function:
10061  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10062  Summary:
10063  DMA transfers are halted during Idle mode.
10064  Description:
10065  This function halts DMA transfers during Idle mode.
10066  Precondition:
10067  None.
10068  Parameters:
10069  None.
10070  Returns:
10071  None.
10072  Example:
10073  <code>
10074  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10075  </code>
10076  Remarks:
10077  This function implements an operation of the StopInIdle feature.
10078  This feature may not be available on all devices. Please refer to the
10079  specific device data sheet to determine availability or use the
10080  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10081  determine whether this feature is available.
10082 */
10083 
10084 void
10086  DMA_MODULE_ID index ) ;
10087 //******************************************************************************
10088 /* Function:
10089  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10090  Summary:
10091  DMA transfers continue during Idle mode.
10092  Description:
10093  This function causes DMA transfers to continue during Idle mode.
10094  Precondition:
10095  None.
10096  Parameters:
10097  None.
10098  Returns:
10099  None.
10100  Example:
10101  <code>
10102  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10103  </code>
10104  Remarks:
10105  This function implements an operation of the StopInIdle feature.
10106  This feature may not be available on all devices. Please refer to the
10107  specific device data sheet to determine availability or use the
10108  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10109  determine whether this feature is available.
10110 */
10111 
10112 void
10114  DMA_MODULE_ID index ) ;
10115 //******************************************************************************
10116 /* Function:
10117  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10118  Summary:
10119  DMA module is enabled.
10120  Description:
10121  This function enables the DMA module.
10122  Precondition:
10123  None.
10124  Parameters:
10125  None.
10126  Returns:
10127  None.
10128  Example:
10129  <code>
10130  PLIB_DMA_Enable( DMA_ID_0 );
10131  </code>
10132  Remarks:
10133  This function implements an operation of the EnableControl feature.
10134  This feature may not be available on all devices. Please refer to the
10135  specific device data sheet to determine availability or use the
10136  PLIB_DMA_ExistsEnableControl function in your application to automatically
10137  determine whether this feature is available.
10138 */
10139 
10140 void
10141  PLIB_DMA_Enable (
10142  DMA_MODULE_ID index ) ;
10143 //******************************************************************************
10144 /* Function:
10145  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10146  Summary:
10147  Returns the DMA module enable status.
10148  Description:
10149  This function returns the DMA module enable status.
10150  Precondition:
10151  None.
10152  Parameters:
10153  None.
10154  Returns:
10155  - true - The DMA is enabled
10156  - false - The DMA is disabled
10157  Example:
10158  <code>
10159  PLIB_DMA_IsEnabled( DMA_ID_0 );
10160  </code>
10161  Remarks:
10162  This function implements an operation of the EnableControl feature.
10163  This feature may not be available on all devices. Please refer to the
10164  specific device data sheet to determine availability or use the
10165  PLIB_DMA_ExistsEnableControl function in your application to automatically
10166  determine whether this feature is available.
10167 */
10168 
10169 bool
10171  DMA_MODULE_ID index ) ;
10172 //******************************************************************************
10173 /* Function:
10174  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10175  Summary:
10176  DMA module is disabled.
10177  Description:
10178  This function disables the DMA module.
10179  Precondition:
10180  None.
10181  Parameters:
10182  None.
10183  Returns:
10184  None.
10185  Example:
10186  <code>
10187  PLIB_DMA_Disable( DMA_ID_0 );
10188  </code>
10189  Remarks:
10190  This function implements an operation of the EnableControl feature.
10191  This feature may not be available on all devices. Please refer to the
10192  specific device data sheet to determine availability or use the
10193  PLIB_DMA_ExistsEnableControl function in your application to automatically
10194  determine whether this feature is available.
10195 */
10196 
10197 void
10199  DMA_MODULE_ID index ) ;
10200 // *****************************************************************************
10201 // *****************************************************************************
10202 // Section: DMA status functions
10203 // *****************************************************************************
10204 // *****************************************************************************
10205 //******************************************************************************
10206 /* Function:
10207  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10208  Summary:
10209  Returns the DMA channel bits.
10210  Description:
10211  This function returns the channel bits.
10212  Precondition:
10213  None.
10214  Parameters:
10215  None.
10216  Returns:
10217  - uint8_t - DMA channel bits
10218  Example:
10219  <code>
10220  uint8_t dmaChBits;
10221  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10222  </code>
10223  Remarks:
10224  This function implements an operation of the ChannelBits feature.
10225  This feature may not be available on all devices. Please refer to the
10226  specific device data sheet to determine availability or use the
10227  PLIB_DMA_ExistsChannelBits function in your application to automatically
10228  determine whether this feature is available.
10229 */
10230 
10231 uint8_t
10233  DMA_MODULE_ID index ) ;
10234 //******************************************************************************
10235 /* Function:
10236  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10237  Summary:
10238  Returns true if the last DMA bus access was a read.
10239  Description:
10240  This function returns true if the last DMA bus access was a read.
10241  Precondition:
10242  None.
10243  Parameters:
10244  None.
10245  Returns:
10246  - true - The last bus access was a read
10247  - false - The last bus access was not a read
10248  Example:
10249  <code>
10250  bool dmaLastBusAccessType;
10251  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10252  </code>
10253  Remarks:
10254  This function implements an operation of the LastBusAccess feature.
10255  This feature may not be available on all devices. Please refer to the
10256  specific device data sheet to determine availability or use the
10257  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10258  determine whether this feature is available.
10259 */
10260 
10261 bool
10263  DMA_MODULE_ID index ) ;
10264 //******************************************************************************
10265 /* Function:
10266  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10267  Summary:
10268  Returns true if the last DMA bus access was a write.
10269  Description:
10270  This function returns true if the last DMA bus access was a write operation.
10271  Precondition:
10272  None.
10273  Parameters:
10274  None.
10275  Returns:
10276  - true - The last bus access was a write operation
10277  - false - The last bus access was not a write operation
10278  Example:
10279  <code>
10280  bool dmaLastBusAccessType;
10281  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10282  </code>
10283  Remarks:
10284  This function implements an operation of the LastBusAccess feature.
10285  This feature may not be available on all devices. Please refer to the
10286  specific device data sheet to determine availability or use the
10287  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10288  determine whether this feature is available.
10289 */
10290 
10291 bool
10293  DMA_MODULE_ID index ) ;
10294 //******************************************************************************
10295 /* Function:
10296  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10297  Summary:
10298  Returns the address of the most recent DMA access.
10299  Description:
10300  This function returns the address of the most recent DMA access.
10301  Precondition:
10302  None.
10303  Parameters:
10304  None.
10305  Returns:
10306  - uint32_t - The most recent address accessed by the DMA
10307  Example:
10308  <code>
10309  uint32_t dmaLastAddressAccessed;
10310  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10311  </code>
10312  Remarks:
10313  This function implements an operation of the RecentAddress feature.
10314  This feature may not be available on all devices. Please refer to the
10315  specific device data sheet to determine availability or use the
10316  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10317  determine whether this feature is available.
10318 */
10319 
10320 uint32_t
10322  DMA_MODULE_ID index ) ;
10323 // *****************************************************************************
10324 // *****************************************************************************
10325 // Section: DMA Module CRC Feature Interface Functions
10326 // *****************************************************************************
10327 // *****************************************************************************
10328 //******************************************************************************
10329 /* Function:
10330  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10331  DMA_CHANNEL channel )
10332  Summary:
10333  Assigns the CRC to the specified DMA channel.
10334  Description:
10335  This function assigns the CRC feature to the specified channel.
10336  Precondition:
10337  None.
10338  Parameters:
10339  channel - One of the possible DMA channels listed by DMA_CHANNEL
10340  Returns:
10341  None.
10342  Example:
10343  <code>
10344  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10345  DMA_CHANNEL_5 );
10346  </code>
10347  Remarks:
10348  This function implements an operation of the CRCChannel feature.
10349  This feature may not be available on all devices. Please refer to the
10350  specific device data sheet to determine availability or use the
10351  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10352  determine whether this feature is available.
10353 */
10354 
10355 void
10357  DMA_MODULE_ID index ,
10358  DMA_CHANNEL channel ) ;
10359 //******************************************************************************
10360 /* Function:
10361  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10362  Summary:
10363  Returns the current DMA channel to which the CRC is assigned.
10364  Description:
10365  This function returns the current DMA channel to which the CRC is assigned.
10366  Precondition:
10367  None.
10368  Parameters:
10369  None.
10370  Returns:
10371  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10372  Example:
10373  <code>
10374  DMA_CHANNEL crcChannel;
10375  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10376  </code>
10377  Remarks:
10378  This function implements an operation of the CRCChannel feature.
10379  This feature may not be available on all devices. Please refer to the
10380  specific device data sheet to determine availability or use the
10381  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10382  determine whether this feature is available.
10383 */
10384 
10385 DMA_CHANNEL
10387  DMA_MODULE_ID index ) ;
10388 //******************************************************************************
10389 /* Function:
10390  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10391  DMA_CRC_TYPE CRCType )
10392  Summary:
10393  Selects the DMA module CRC feature type.
10394  Description:
10395  This function selects the DMA module CRC feature type. The CRC feature will
10396  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10397  checksum.
10398  Precondition:
10399  None.
10400  Parameters:
10401  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10402  Returns:
10403  None.
10404  Example:
10405  <code>
10406  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10407  DMA_CRC_IP_HEADER );
10408  </code>
10409  Remarks:
10410  This function implements an operation of the CRCType feature.
10411  This feature may not be available on all devices. Please refer to the
10412  specific device data sheet to determine availability or use the
10413  PLIB_DMA_ExistsCRCType function in your application to automatically
10414  determine whether this feature is available.
10415 */
10416 
10417 void
10419  DMA_MODULE_ID index ,
10420  DMA_CRC_TYPE CRCType ) ;
10421 //******************************************************************************
10422 /* Function:
10423  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10424  Summary:
10425  Gets the current DMA module CRC feature type.
10426  Description:
10427  This function gets the DMA module CRC feature type. The CRC feature will
10428  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10429  checksum.
10430  Precondition:
10431  None.
10432  Parameters:
10433  None.
10434  Returns:
10435  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10436  Example:
10437  <code>
10438  DMA_CRC_TYPE CRCType;
10439  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10440  </code>
10441  Remarks:
10442  This function implements an operation of the CRCType feature.
10443  This feature may not be available on all devices. Please refer to the
10444  specific device data sheet to determine availability or use the
10445  PLIB_DMA_ExistsCRCType function in your application to automatically
10446  determine whether this feature is available.
10447 */
10448 
10449 DMA_CRC_TYPE
10451  DMA_MODULE_ID index ) ;
10452 //******************************************************************************
10453 /* Function:
10454  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10455  Summary:
10456  Enables the CRC append mode.
10457  Description:
10458  This function enables the CRC append mode. The DMA transfers data from the source
10459  into the CRC, but not to the destination. When a block transfer completes, the
10460  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10461  Precondition:
10462  None.
10463  Parameters:
10464  None.
10465  Returns:
10466  None.
10467  Example:
10468  <code>
10469  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10470  </code>
10471  Remarks:
10472  This function implements an operation of the CRCAppendMode feature.
10473  This feature may not be available on all devices. Please refer to the
10474  specific device data sheet to determine availability or use the
10475  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10476  determine whether this feature is available.
10477 */
10478 
10479 void
10481  DMA_MODULE_ID index ) ;
10482 //******************************************************************************
10483 /* Function:
10484  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10485  Summary:
10486  Gets the enable status of the CRC append mode.
10487  Description:
10488  This function gets the enable status of the CRC append mode.
10489  Precondition:
10490  None.
10491  Parameters:
10492  None.
10493  Returns:
10494  - true - CRC append mode is enabled
10495  - false - CRC append mode is disabled
10496  Example:
10497  <code>
10498  bool DMAcrcAppendMode;
10499  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10500  </code>
10501  Remarks:
10502  This function implements an operation of the CRCAppendMode feature.
10503  This feature may not be available on all devices. Please refer to the
10504  specific device data sheet to determine availability or use the
10505  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10506  determine whether this feature is available.
10507 */
10508 
10509 bool
10511  DMA_MODULE_ID index ) ;
10512 //******************************************************************************
10513 /* Function:
10514  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10515  Summary:
10516  Disables the CRC append mode.
10517  Description:
10518  This function disables the CRC append mode. The DMA transfers data from the
10519  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10520  as it writes the data to the destination.
10521  Precondition:
10522  None.
10523  Parameters:
10524  None.
10525  Returns:
10526  None.
10527  Example:
10528  <code>
10529  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
10530  </code>
10531  Remarks:
10532  This function implements an operation of the CRCAppendMode feature.
10533  This feature may not be available on all devices. Please refer to the
10534  specific device data sheet to determine availability or use the
10535  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10536  determine whether this feature is available.
10537 */
10538 
10539 void
10541  DMA_MODULE_ID index ) ;
10542 //******************************************************************************
10543 /* Function:
10544  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
10545  Summary:
10546  Enables the DMA module CRC feature.
10547  Description:
10548  This function enables the DMA module CRC feature. The channel transfers are
10549  routed through the CRC.
10550  Precondition:
10551  None.
10552  Parameters:
10553  None.
10554  Returns:
10555  None.
10556  Example:
10557  <code>
10558  PLIB_DMA_CRCEnable( DMA_ID_0 );
10559  </code>
10560  Remarks:
10561  This function implements an operation of the CRC feature.
10562  This feature may not be available on all devices. Please refer to the
10563  specific device data sheet to determine availability or use the
10564  PLIB_DMA_ExistsCRC function in your application to automatically
10565  determine whether this feature is available.
10566 */
10567 
10568 void
10570  DMA_MODULE_ID index ) ;
10571 //******************************************************************************
10572 /* Function:
10573  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
10574  Summary:
10575  Gets the enable status of the CRC feature.
10576  Description:
10577  This function gets the enable status of the CRC feature.
10578  Precondition:
10579  None.
10580  Parameters:
10581  None.
10582  Returns:
10583  - true - The CRC feature is enabled
10584  - false - The CRC feature is disabled
10585  Example:
10586  <code>
10587  bool DMAcrcStatus;
10588  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
10589  </code>
10590  Remarks:
10591  This function implements an operation of the CRC feature.
10592  This feature may not be available on all devices. Please refer to the
10593  specific device data sheet to determine availability or use the
10594  PLIB_DMA_ExistsCRC function in your application to automatically
10595  determine whether this feature is available.
10596 */
10597 
10598 bool
10600  DMA_MODULE_ID index ) ;
10601 //******************************************************************************
10602 /* Function:
10603  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
10604  Summary:
10605  Disables the DMA module CRC feature.
10606  Description:
10607  This function disables the DMA module CRC feature. The channel transfers proceed
10608  normally.
10609  Precondition:
10610  None.
10611  Parameters:
10612  None.
10613  Returns:
10614  None.
10615  Example:
10616  <code>
10617  PLIB_DMA_CRCDisable( DMA_ID_0 );
10618  </code>
10619  Remarks:
10620  This function implements an operation of the CRC feature.
10621  This feature may not be available on all devices. Please refer to the
10622  specific device data sheet to determine availability or use the
10623  PLIB_DMA_ExistsCRC function in your application to automatically
10624  determine whether this feature is available.
10625 */
10626 
10627 void
10629  DMA_MODULE_ID index ) ;
10630 //******************************************************************************
10631 /* Function:
10632  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
10633  uint8_t polyLength )
10634  Summary:
10635  Selects the polynomial length.
10636  Description:
10637  This function Selects the polynomial length.
10638  Precondition:
10639  None.
10640  Parameters:
10641  polyLength - Polynomial length
10642  Returns:
10643  None.
10644  Example:
10645  <code>
10646  uint8_t polyLength = 0x2;
10647  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
10648  </code>
10649  Remarks:
10650  This function implements an operation of the CRCPolynomialLength feature.
10651  This feature may not be available on all devices. Please refer to the
10652  specific device data sheet to determine availability or use the
10653  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10654  determine whether this feature is available.
10655 */
10656 
10657 void
10659  DMA_MODULE_ID index ,
10660  uint8_t polyLength ) ;
10661 //******************************************************************************
10662 /* Function:
10663  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
10664  Summary:
10665  Gets the current polynomial length.
10666  Description:
10667  This function gets the current polynomial length.
10668  Precondition:
10669  None.
10670  Parameters:
10671  None.
10672  Returns:
10673  - uint8_t - Polynomial length
10674  Example:
10675  <code>
10676  uint8_t polyLength;
10677  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
10678  </code>
10679  Remarks:
10680  This function implements an operation of the CRCPolynomialLength feature.
10681  This feature may not be available on all devices. Please refer to the
10682  specific device data sheet to determine availability or use the
10683  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10684  determine whether this feature is available.
10685 */
10686 
10687 uint8_t
10689  DMA_MODULE_ID index ) ;
10690 //******************************************************************************
10691 /* Function:
10692  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
10693  DMA_CRC_BIT_ORDER bitOrder )
10694  Summary:
10695  Selects the bit order for checksum calculation.
10696  Description:
10697  This function selects the bit order for checksum calculation.
10698  Precondition:
10699  None.
10700  Parameters:
10701  bitOrder - Specifies the bit order for CRC calculation
10702  Returns:
10703  None.
10704  Example:
10705  <code>
10706  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
10707  </code>
10708  Remarks:
10709  This function implements an operation of the CRCBitOrder feature.
10710  This feature may not be available on all devices. Please refer to the
10711  specific device data sheet to determine availability or use the
10712  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
10713  determine whether this feature is available.
10714 */
10715 
10716 void
10718  DMA_MODULE_ID index ,
10719  DMA_CRC_BIT_ORDER bitOrder ) ;
10720 //******************************************************************************
10721 /* Function:
10722  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
10723  Summary:
10724  The source data is written to the destination reordered as defined by the
10725  BYTO<1:0> bits.
10726  Description:
10727  This function enables byte order alteration as specified by the BYTO<1:0> bits.
10728  The source data is written to the destination reordered as defined by the
10729  BYTO<1:0> bits.
10730  Precondition:
10731  None.
10732  Parameters:
10733  None.
10734  Returns:
10735  None.
10736  Example:
10737  <code>
10738  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
10739  </code>
10740  Remarks:
10741  This function implements an operation of the CRCWriteByteOrder feature.
10742  This feature may not be available on all devices. Please refer to the
10743  specific device data sheet to determine availability or use the
10744  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10745  determine whether this feature is available.
10746 */
10747 
10748 void
10750  DMA_MODULE_ID index ) ;
10751 //******************************************************************************
10752 /* Function:
10753  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
10754  Summary:
10755  The source data is written to the destination unaltered.
10756  Description:
10757  This function disables byte order alteration. The source data is written
10758  to the destination unaltered.
10759  Precondition:
10760  None.
10761  Parameters:
10762  None.
10763  Returns:
10764  None.
10765  Example:
10766  <code>
10767  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
10768  </code>
10769  Remarks:
10770  This function implements an operation of the CRCWriteByteOrder feature.
10771  This feature may not be available on all devices. Please refer to the
10772  specific device data sheet to determine availability or use the
10773  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10774  determine whether this feature is available.
10775 */
10776 
10777 void
10779  DMA_MODULE_ID index ) ;
10780 //******************************************************************************
10781 /* Function:
10782  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
10783  DMA_CRC_BYTE_ORDER byteOrder )
10784  Summary:
10785  Selects the byte order.
10786  Description:
10787  This function selects the byte order.
10788  Precondition:
10789  The WBO bit must be set to use this function.
10790  Parameters:
10791  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10792  Returns:
10793  None.
10794  Example:
10795  <code>
10796  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
10797  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
10798  </code>
10799  Remarks:
10800  This function implements an operation of the CRCByteOrder feature.
10801  This feature may not be available on all devices. Please refer to the
10802  specific device data sheet to determine availability or use the
10803  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10804  determine whether this feature is available.
10805 */
10806 
10807 void
10809  DMA_MODULE_ID index ,
10810  DMA_CRC_BYTE_ORDER byteOrder ) ;
10811 //******************************************************************************
10812 /* Function:
10813  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
10814  Summary:
10815  Gets the current byte order selected by the DMA module CRC feature.
10816  Description:
10817  This function gets the current byte order selected by the DMA module CRC feature.
10818  Precondition:
10819  The WBO bit must be set to use this function.
10820  Parameters:
10821  None.
10822  Returns:
10823  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10824  Example:
10825  <code>
10826  DMA_CRC_BYTE_ORDER byteOrder;
10827  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
10828  </code>
10829  Remarks:
10830  This function implements an operation of the CRCByteOrder feature.
10831  This feature may not be available on all devices. Please refer to the
10832  specific device data sheet to determine availability or use the
10833  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10834  determine whether this feature is available.
10835 */
10836 
10837 DMA_CRC_BYTE_ORDER
10839  DMA_MODULE_ID index ) ;
10840 //******************************************************************************
10841 /* Function:
10842  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
10843  Summary:
10844  Reads the contents of the DMA CRC data register.
10845  Description:
10846  This function reads the contents of the DMA CRC data register.
10847  Precondition:
10848  None.
10849  Parameters:
10850  None.
10851  Returns:
10852  - uint32_t - 32-bit CRC data
10853  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10854  device data sheet to determine availability.
10855  Example:
10856  <code>
10857  uint32_t DMACRCdata;
10858  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
10859  </code>
10860  Remarks:
10861  This function implements an operation of the CRCData feature.
10862  This feature may not be available on all devices. Please refer to the
10863  specific device data sheet to determine availability or use the
10864  PLIB_DMA_ExistsCRCData function in your application to automatically
10865  determine whether this feature is available.
10866 */
10867 
10868 uint32_t
10870  DMA_MODULE_ID index ) ;
10871 //******************************************************************************
10872 /* Function:
10873  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
10874  uint32_t DMACRCdata )
10875  Summary:
10876  Writes the contents of the DMA CRC data register with the specified data.
10877  Description:
10878  This function writes the contents of the DMA CRC data register.
10879  Precondition:
10880  None.
10881  Parameters:
10882  - DMACRCdata - 32-bit CRC data
10883  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10884  device data sheet to determine availability.
10885  Returns:
10886  None.
10887  Example:
10888  <code>
10889  uint32_t DMACRCdata = 0x0E0E0E;
10890  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
10891  </code>
10892  Remarks:
10893  This function implements an operation of the CRCData feature.
10894  This feature may not be available on all devices. Please refer to the
10895  specific device data sheet to determine availability or use the
10896  PLIB_DMA_ExistsCRCData function in your application to automatically
10897  determine whether this feature is available.
10898 */
10899 
10900 void
10902  DMA_MODULE_ID index ,
10903  uint32_t DMACRCdata ) ;
10904 //******************************************************************************
10905 /* Function:
10906  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
10907  Summary:
10908  Reads the CRC XOR register.
10909  Description:
10910  This function reads the CRC XOR register.
10911  Precondition:
10912  None.
10913  Parameters:
10914  None.
10915  Returns:
10916  - uint32_t - 32-bit CRC XOR enable mask data
10917  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10918  device data sheet to determine availability.
10919  Example:
10920  <code>
10921  uint32_t DMACRCXORdata;
10922  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
10923  </code>
10924  Remarks:
10925  This function implements an operation of the CRCXOREnable feature.
10926  This feature may not be available on all devices. Please refer to the
10927  specific device data sheet to determine availability or use the
10928  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10929  determine whether this feature is available.
10930 */
10931 
10932 uint32_t
10934  DMA_MODULE_ID index ) ;
10935 //******************************************************************************
10936 /* Function:
10937  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
10938  uint32_t DMACRCXOREnableMask )
10939  Summary:
10940  Writes to the CRC XOR enable register as per the specified enable mask.
10941  Description:
10942  This function writes to the CRC XOR enable register as per the specified
10943  enable mask. Each enabled bit will be taken as input to the shift register.
10944  Precondition:
10945  None.
10946  Parameters:
10947  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
10948  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10949  device data sheet to determine availability.
10950  Returns:
10951  None.
10952  Example:
10953  <code>
10954  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
10955  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
10956  </code>
10957  Remarks:
10958  This function implements an operation of the CRCXOREnable feature.
10959  This feature may not be available on all devices. Please refer to the
10960  specific device data sheet to determine availability or use the
10961  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10962  determine whether this feature is available.
10963 */
10964 
10965 void
10967  DMA_MODULE_ID index ,
10968  uint32_t DMACRCXOREnableMask ) ;
10969 // *****************************************************************************
10970 // *****************************************************************************
10971 // Section: DMA Address control Interface functions
10972 // *****************************************************************************
10973 // *****************************************************************************
10974 //******************************************************************************
10975 /* Function:
10976  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
10977  DMA_CHANNEL dmaChannel )
10978  Summary:
10979  Reads the source start address configured for the specified channel.
10980  Description:
10981  This function reads the source start address configured for the specified
10982  channel.
10983  Precondition:
10984  None.
10985  Parameters:
10986  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
10987  Returns:
10988  - uint32_t - The source start address configured for this channel
10989  Example:
10990  <code>
10991  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
10992  uint32_t SourceStartAddress;
10993  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
10994  spiDMAChannel );
10995  </code>
10996  Remarks:
10997  This function implements an operation of the ChannelXSourceStartAddress feature.
10998  This feature may not be available on all devices. Please refer to the
10999  specific device data sheet to determine availability or use the
11000  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11001  determine whether this feature is available.
11002 */
11003 
11004 uint32_t
11006  DMA_MODULE_ID index ,
11007  DMA_CHANNEL dmaChannel ) ;
11008 //******************************************************************************
11009 /* Function:
11010  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11011  DMA_CHANNEL dmaChannel,
11012  uint32_t sourceStartAddress)
11013  Summary:
11014  Writes the specified source start address into the register
11015  corresponding to the specified channel.
11016  Description:
11017  This function writes the specified Source start address into the register
11018  corresponding to the specified channel.
11019  Precondition:
11020  None.
11021  Parameters:
11022  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11023  sourceStartAddress - The source start address
11024  Returns:
11025  None.
11026  Example:
11027  <code>
11028  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11029  uint32_t sourceStartAddress = 0x00FDEA00;
11030  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11031  spiDMAChannel,
11032  sourceStartAddress );
11033  </code>
11034  Remarks:
11035  This function implements an operation of the ChannelXSourceStartAddress feature.
11036  This feature may not be available on all devices. Please refer to the
11037  specific device data sheet to determine availability or use the
11038  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11039  determine whether this feature is available.
11040 */
11041 
11042 void
11044  DMA_MODULE_ID index ,
11045  DMA_CHANNEL dmaChannel ,
11046  uint32_t sourceStartAddress ) ;
11047 //******************************************************************************
11048 /* Function:
11049  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11050  DMA_CHANNEL dmaChannel )
11051  Summary:
11052  Reads the destination start address configured for the specified channel.
11053  Description:
11054  This function reads the destination start address configured for the specified
11055  channel.
11056  Precondition:
11057  None.
11058  Parameters:
11059  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11060  Returns:
11061  - uint32_t - The destination start address configured for this channel
11062  Example:
11063  <code>
11064  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11065  uint32_t DestinationStartAddress;
11066  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11067  DMA_ID_0,
11068  spiDMAChannel );
11069  </code>
11070  Remarks:
11071  This function implements an operation of the ChannelXDestinationStartAddress feature.
11072  This feature may not be available on all devices. Please refer to the
11073  specific device data sheet to determine availability or use the
11074  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11075  determine whether this feature is available.
11076 */
11077 
11078 uint32_t
11080  DMA_MODULE_ID index ,
11081  DMA_CHANNEL dmaChannel ) ;
11082 //******************************************************************************
11083 /* Function:
11084  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11085  DMA_MODULE_ID index,
11086  DMA_CHANNEL dmaChannel,
11087  uint32_t destinationStartAddress)
11088  Summary:
11089  Writes the specified destination start address into the register corresponding to
11090  the specified channel.
11091  Description:
11092  This function writes the specified destination start address into the register
11093  corresponding to the specified channel.
11094  Precondition:
11095  None.
11096  Parameters:
11097  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11098  destinationStartAddress - The destination start address
11099  Returns:
11100  None.
11101  Example:
11102  <code>
11103  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11104  uint32_t destinationStartAddress = 0x00FDEA00;
11105  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11106  spiDMAChannel,
11107  destinationStartAddress );
11108  </code>
11109  Remarks:
11110  This function implements an operation of the ChannelXDestinationStartAddress feature.
11111  This feature may not be available on all devices. Please refer to the
11112  specific device data sheet to determine availability or use the
11113  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11114  determine whether this feature is available.
11115 */
11116 
11117 void
11119  DMA_MODULE_ID index ,
11120  DMA_CHANNEL dmaChannel ,
11121  uint32_t destinationStartAddress ) ;
11122 // *****************************************************************************
11123 // *****************************************************************************
11124 // Section: DMA Data control Interface functions
11125 // *****************************************************************************
11126 // *****************************************************************************
11127 //******************************************************************************
11128 /* Function:
11129  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11130  DMA_CHANNEL dmaChannel )
11131  Summary:
11132  Reads the source size configured for the specified channel.
11133  Description:
11134  This function reads the source size configured for the specified
11135  channel.
11136  Precondition:
11137  None.
11138  Parameters:
11139  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11140  Returns:
11141  - uint16_t - The Source size configured (in bytes) for this channel.
11142  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11143  device data sheet to determine availability.
11144  Example:
11145  <code>
11146  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11147  uint16_t sourceSize;
11148  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11149  spiDMAChannel );
11150  </code>
11151  Remarks:
11152  This function implements an operation of the ChannelXSourceSize feature.
11153  This feature may not be available on all devices. Please refer to the
11154  specific device data sheet to determine availability or use the
11155  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11156  determine whether this feature is available.
11157 */
11158 
11159 uint16_t
11161  DMA_MODULE_ID index ,
11162  DMA_CHANNEL dmaChannel ) ;
11163 //******************************************************************************
11164 /* Function:
11165  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11166  DMA_CHANNEL dmaChannel,
11167  uint16_t sourceSize)
11168  Summary:
11169  Writes the specified source size into the register corresponding
11170  to the specified channel.
11171  Description:
11172  This function writes the specified source size into the register
11173  corresponding to the specified channel.
11174  Precondition:
11175  None.
11176  Parameters:
11177  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11178  sourceSize - The source size. The source size (8-bit, 16-bit) is
11179  device-specific. Please refer to the specific device data
11180  sheet to determine availability.
11181  Returns:
11182  None.
11183  Example:
11184  <code>
11185  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11186  uint16_t sourceSize = 0xA00;
11187  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11188  spiDMAChannel,
11189  sourceSize );
11190  </code>
11191  Remarks:
11192  This function implements an operation of the ChannelXSourceSize feature.
11193  This feature may not be available on all devices. Please refer to the
11194  specific device data sheet to determine availability or use the
11195  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11196  determine whether this feature is available.
11197 */
11198 
11199 void
11201  DMA_MODULE_ID index ,
11202  DMA_CHANNEL dmaChannel ,
11203  uint16_t sourceSize ) ;
11204 //******************************************************************************
11205 /* Function:
11206  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11207  DMA_CHANNEL dmaChannel )
11208  Summary:
11209  Reads the destination size configured for the specified channel.
11210  Description:
11211  This function reads the destination size configured for the specified
11212  channel.
11213  Precondition:
11214  None.
11215  Parameters:
11216  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11217  Returns:
11218  - uint16_t - The destination size configured (in bytes) for this channel.
11219  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11220  device data sheet to determine availability.
11221  Example:
11222  <code>
11223  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11224  uint16_t DestinationSize;
11225  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11226  spiDMAChannel );
11227  </code>
11228  Remarks:
11229  This function implements an operation of the ChannelXDestinationSize feature.
11230  This feature may not be available on all devices. Please refer to the
11231  specific device data sheet to determine availability or use the
11232  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11233  determine whether this feature is available.
11234 */
11235 
11236 uint16_t
11238  DMA_MODULE_ID index ,
11239  DMA_CHANNEL dmaChannel ) ;
11240 //******************************************************************************
11241 /* Function:
11242  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11243  DMA_CHANNEL dmaChannel,
11244  uint16_t destinationSize)
11245  Summary:
11246  Writes the specified destination size into the register corresponding
11247  to the specified channel.
11248  Description:
11249  This function writes the specified destination size into the register
11250  corresponding to the specified channel.
11251  Precondition:
11252  None.
11253  Parameters:
11254  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11255  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11256  is device-specific. Please refer to the specific device
11257  data sheet to determine availability.)
11258  Returns:
11259  None.
11260  Example:
11261  <code>
11262  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11263  uint16_t destinationSize = 0xA00;
11264  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11265  </code>
11266  Remarks:
11267  This function implements an operation of the ChannelXDestinationSize feature.
11268  This feature may not be available on all devices. Please refer to the
11269  specific device data sheet to determine availability or use the
11270  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11271  determine whether this feature is available.
11272 */
11273 
11274 void
11276  DMA_MODULE_ID index ,
11277  DMA_CHANNEL dmaChannel ,
11278  uint16_t destinationSize ) ;
11279 //******************************************************************************
11280 /* Function:
11281  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11282  DMA_CHANNEL dmaChannel )
11283  Summary:
11284  Reads the current byte of the source being pointed to for the specified channel.
11285  Description:
11286  This function reads the current byte of the source being pointed to for the
11287  specified channel.
11288  Precondition:
11289  None.
11290  Parameters:
11291  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11292  Returns:
11293  - uint16_t - The source byte being pointed to for this channel.
11294  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11295  device data sheet to determine availability.
11296  Example:
11297  <code>
11298  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11299  uint16_t sourcebyte;
11300  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11301  </code>
11302  Remarks:
11303  This function implements an operation of the ChannelXSourcePointer feature.
11304  This feature may not be available on all devices. Please refer to the
11305  specific device data sheet to determine availability or use the
11306  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11307  determine whether this feature is available.
11308 */
11309 
11310 uint16_t
11312  DMA_MODULE_ID index ,
11313  DMA_CHANNEL dmaChannel ) ;
11314 //******************************************************************************
11315 /* Function:
11316  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11317  DMA_CHANNEL dmaChannel )
11318  Summary:
11319  Reads the current byte of the destination being pointed to for the specified channel.
11320  Description:
11321  This function reads the current byte of the destination being pointed to for the
11322  specified channel.
11323  Precondition:
11324  None.
11325  Parameters:
11326  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11327  Returns:
11328  - uint16_t - The destination byte being pointed to for this channel.
11329  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11330  device data sheet to determine availability.
11331  Example:
11332  <code>
11333  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11334  uint16_t destinationbyte;
11335  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11336  spiDMAChannel );
11337  </code>
11338  Remarks:
11339  This function implements an operation of the ChannelXDestinationPointer feature.
11340  This feature may not be available on all devices. Please refer to the
11341  specific device data sheet to determine availability or use the
11342  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11343  determine whether this feature is available.
11344 */
11345 
11346 uint16_t
11348  DMA_MODULE_ID index ,
11349  DMA_CHANNEL dmaChannel ) ;
11350 //******************************************************************************
11351 /* Function:
11352  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11353  DMA_CHANNEL dmaChannel )
11354  Summary:
11355  Reads the cell size (in bytes) configured for the specified channel.
11356  Description:
11357  This function reads the cell size (in bytes) configured for the specified
11358  channel.
11359  Precondition:
11360  None.
11361  Parameters:
11362  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11363  Returns:
11364  - uint16_t - The cell size configured (in bytes) for this channel
11365  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11366  device data sheet to determine availability.
11367  Example:
11368  <code>
11369  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11370  uint16_t cellSize;
11371  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11372  spiDMAChannel );
11373  </code>
11374  Remarks:
11375  This function implements an operation of the ChannelXCellSize feature.
11376  This feature may not be available on all devices. Please refer to the
11377  specific device data sheet to determine availability or use the
11378  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11379  determine whether this feature is available.
11380 */
11381 
11382 uint16_t
11384  DMA_MODULE_ID index ,
11385  DMA_CHANNEL dmaChannel ) ;
11386 //******************************************************************************
11387 /* Function:
11388  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11389  DMA_CHANNEL dmaChannel,
11390  uint16_t cellSize)
11391  Summary:
11392  Writes the specified cell size into the register corresponding
11393  to the specified channel.
11394  Description:
11395  This function writes the specified cell size into the register
11396  corresponding to the specified channel.
11397  Precondition:
11398  None.
11399  Parameters:
11400  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11401  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11402  device-specific. Please refer to the specific device data
11403  sheet to determine availability.)
11404  Returns:
11405  None.
11406  Example:
11407  <code>
11408  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11409  uint16_t cellSize = 0x10;
11410  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11411  </code>
11412  Remarks:
11413  This function implements an operation of the ChannelXCellSize feature.
11414  This feature may not be available on all devices. Please refer to the
11415  specific device data sheet to determine availability or use the
11416  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11417  determine whether this feature is available.
11418 */
11419 
11420 void
11422  DMA_MODULE_ID index ,
11423  DMA_CHANNEL dmaChannel ,
11424  uint16_t CellSize ) ;
11425 //******************************************************************************
11426 /* Function:
11427  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11428  DMA_CHANNEL dmaChannel )
11429  Summary:
11430  Returns the number of bytes transferred since the last event.
11431  Description:
11432  This function returns the number of bytes transferred since the last event.
11433  Precondition:
11434  None.
11435  Parameters:
11436  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11437  Returns:
11438  - uint16_t - The number of bytes transferred since the last event.
11439  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11440  the specific device data sheet to determine availability.
11441  Example:
11442  <code>
11443  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11444  uint16_t CellProgress;
11445  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11446  spiDMAChannel );
11447  </code>
11448  Remarks:
11449  This function implements an operation of the ChannelXCellProgressPointer feature.
11450  This feature may not be available on all devices. Please refer to the
11451  specific device data sheet to determine availability or use the
11452  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11453  determine whether this feature is available.
11454 */
11455 
11456 uint16_t
11458  DMA_MODULE_ID index ,
11459  DMA_CHANNEL dmaChannel ) ;
11460 //******************************************************************************
11461 /* Function:
11462  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11463  DMA_CHANNEL dmaChannel )
11464  Summary:
11465  Returns the pattern matching (for DMA abort) data programmed for the specified
11466  channel.
11467  Description:
11468  This function returns pattern matching (for DMA abort) data programmed for
11469  the specified channel.
11470  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11471  the specific device data sheet to determine availability.)
11472  Precondition:
11473  None.
11474  Parameters:
11475  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11476  Returns:
11477  - uint16_t - The pattern matching data programmed for the current channel.
11478  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11479  the specific device data sheet to determine availability.
11480  Example:
11481  <code>
11482  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11483  uint16_t patternData;
11484  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11485  </code>
11486  Remarks:
11487  This function implements an operation of the ChannelXPatternData feature.
11488  This feature may not be available on all devices. Please refer to the
11489  specific device data sheet to determine availability or use the
11490  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11491  determine whether this feature is available.
11492 */
11493 
11494 uint16_t
11496  DMA_MODULE_ID index ,
11497  DMA_CHANNEL dmaChannel ) ;
11498 //******************************************************************************
11499 /* Function:
11500  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11501  DMA_CHANNEL dmaChannel,
11502  uint16_t patternData)
11503  Summary:
11504  Writes the specified pattern matching data (for DMA abort) into the register
11505  corresponding to the specified channel.
11506  Description:
11507  This function writes the specified pattern matching data (for DMA abort) into the
11508  register corresponding to the specified channel.
11509  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11510  the specific device data sheet to determine availability.)
11511  Precondition:
11512  None.
11513  Parameters:
11514  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11515  patternData - The pattern matching DATA programmed for the current channel
11516  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11517  the specific device data sheet to determine availability.)
11518  Returns:
11519  None.
11520  Example:
11521  <code>
11522  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11523  uint16_t patternData = '\0';
11524  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
11525  </code>
11526  Remarks:
11527  This function implements an operation of the ChannelXPatternData feature.
11528  This feature may not be available on all devices. Please refer to the
11529  specific device data sheet to determine availability or use the
11530  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11531  determine whether this feature is available.
11532 */
11533 
11534 void
11536  DMA_MODULE_ID index ,
11537  DMA_CHANNEL dmaChannel ,
11538  uint16_t patternData ) ;
11539 // *****************************************************************************
11540 // *****************************************************************************
11541 // Section: DMA Interrupt Control Interface functions
11542 // *****************************************************************************
11543 // *****************************************************************************
11544 //******************************************************************************
11545 /* Function:
11546  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
11547  DMA_CHANNEL dmaChannel,
11548  DMA_INT_TYPE dmaINTSource )
11549  Summary:
11550  Returns the status of the interrupt flag of the specified DMA interrupt source
11551  for the specified channel.
11552  Description:
11553  This function returns the status of the interrupt flag of the specified DMA interrupt
11554  source for the specified channel.
11555  Precondition:
11556  None.
11557  Parameters:
11558  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11559  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11560  Returns:
11561  - true - The interrupt flag is set
11562  - false - The interrupt flag is not set
11563  Example:
11564  <code>
11565  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11566  bool AddressErrorINTStatus;
11567  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
11568  DMA_ID_0,
11569  spiDMAChannel,
11570  DMA_INT_ADDRESS_ERROR );
11571  </code>
11572  Remarks:
11573  This function implements an operation of the ChannelXINTSourceFlag feature.
11574  This feature may not be available on all devices. Please refer to the
11575  specific device data sheet to determine availability or use the
11576  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11577  determine whether this feature is available.
11578 */
11579 
11580 bool
11582  DMA_MODULE_ID index ,
11583  DMA_CHANNEL dmaChannel ,
11584  DMA_INT_TYPE dmaINTSource ) ;
11585 //******************************************************************************
11586 /* Function:
11587  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
11588  DMA_CHANNEL dmaChannel,
11589  DMA_INT_TYPE dmaINTSource )
11590  Summary:
11591  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
11592  Description:
11593  This function sets the interrupt flag of the specified DMA interrupt source for
11594  the specified channel.
11595  Precondition:
11596  None.
11597  Parameters:
11598  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11599  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11600  Returns:
11601  None.
11602  Example:
11603  <code>
11604  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11605  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
11606  spiDMAChannel,
11607  DMA_INT_ADDRESS_ERROR );
11608  </code>
11609  Remarks:
11610  This function implements an operation of the ChannelXINTSourceFlag feature.
11611  This feature may not be available on all devices. Please refer to the
11612  specific device data sheet to determine availability or use the
11613  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11614  determine whether this feature is available.
11615 */
11616 
11617 void
11619  DMA_MODULE_ID index ,
11620  DMA_CHANNEL dmaChannel ,
11621  DMA_INT_TYPE dmaINTSource ) ;
11622 //******************************************************************************
11623 /* Function:
11624  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
11625  DMA_CHANNEL dmaChannel,
11626  DMA_INT_TYPE dmaINTSource )
11627  Summary:
11628  Clears the interrupt flag of the specified DMA interrupt source
11629  for the specified channel.
11630  Description:
11631  This function clears the interrupt flag of the specified DMA interrupt source
11632  for the specified channel.
11633  Precondition:
11634  None.
11635  Parameters:
11636  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11637  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11638  Returns:
11639  None.
11640  Example:
11641  <code>
11642  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11643  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
11644  spiDMAChannel,
11645  DMA_INT_ADDRESS_ERROR );
11646  </code>
11647  Remarks:
11648  This function implements an operation of the ChannelXINTSourceFlag feature.
11649  This feature may not be available on all devices. Please refer to the
11650  specific device data sheet to determine availability or use the
11651  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11652  determine whether this feature is available.
11653 */
11654 
11655 void
11657  DMA_MODULE_ID index ,
11658  DMA_CHANNEL dmaChannel ,
11659  DMA_INT_TYPE dmaINTSource ) ;
11660 //******************************************************************************
11661 /* Function:
11662  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
11663  DMA_CHANNEL dmaChannel,
11664  DMA_INT_TYPE dmaINTSource )
11665  Summary:
11666  Enables the specified interrupt source for the specified channel.
11667  Description:
11668  This function enables the specified interrupt source for the specified channel.
11669  Precondition:
11670  None.
11671  Parameters:
11672  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11673  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11674  Returns:
11675  None.
11676  Example:
11677  <code>
11678  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11679  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
11680  spiDMAChannel,
11681  DMA_INT_ADDRESS_ERROR );
11682  </code>
11683  Remarks:
11684  This function implements an operation of the ChannelXINTSource feature.
11685  This feature may not be available on all devices. Please refer to the
11686  specific device data sheet to determine availability or use the
11687  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11688  determine whether this feature is available.
11689 */
11690 
11691 void
11693  DMA_MODULE_ID index ,
11694  DMA_CHANNEL dmaChannel ,
11695  DMA_INT_TYPE dmaINTSource ) ;
11696 //******************************************************************************
11697 /* Function:
11698  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
11699  DMA_CHANNEL dmaChannel,
11700  DMA_INT_TYPE dmaINTSource )
11701  Summary:
11702  Disables the specified interrupt source for the specified channel.
11703  Description:
11704  This function disables the specified interrupt source for the specified channel.
11705  Precondition:
11706  None.
11707  Parameters:
11708  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11709  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11710  Returns:
11711  None.
11712  Example:
11713  <code>
11714  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11715  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
11716  spiDMAChannel,
11717  DMA_INT_ADDRESS_ERROR );
11718  </code>
11719  Remarks:
11720  This function implements an operation of the ChannelXINTSource feature.
11721  This feature may not be available on all devices. Please refer to the
11722  specific device data sheet to determine availability or use the
11723  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11724  determine whether this feature is available.
11725 */
11726 
11727 void
11729  DMA_MODULE_ID index ,
11730  DMA_CHANNEL dmaChannel ,
11731  DMA_INT_TYPE dmaINTSource ) ;
11732 //******************************************************************************
11733 /* Function:
11734  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
11735  DMA_CHANNEL dmaChannel,
11736  DMA_INT_TYPE dmaINTSource )
11737  Summary:
11738  Returns the enable status of the specified interrupt source for the specified channel.
11739  Description:
11740  This function returns the enable status of the specified interrupt source for the
11741  specified channel.
11742  Precondition:
11743  None.
11744  Parameters:
11745  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11746  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11747  Returns:
11748  - true - The interrupt is enabled
11749  - false - The interrupt is not enabled
11750  Example:
11751  <code>
11752  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11753  bool dmaINTSourceEnableStatus;
11754  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
11755  DMA_ID_0,
11756  spiDMAChannel,
11757  DMA_INT_ADDRESS_ERROR );
11758  </code>
11759  Remarks:
11760  This function implements an operation of the ChannelXINTSource feature.
11761  This feature may not be available on all devices. Please refer to the
11762  specific device data sheet to determine availability or use the
11763  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11764  determine whether this feature is available.
11765 */
11766 
11767 bool
11769  DMA_MODULE_ID index ,
11770  DMA_CHANNEL dmaChannel ,
11771  DMA_INT_TYPE dmaINTSource ) ;
11772 //******************************************************************************
11773 /* Function:
11774  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
11775  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
11776  Summary:
11777  Sets the pattern match length.
11778  Description:
11779  This function sets the length of the pattern match ignore to 1 or 2 bytes.
11780  Precondition:
11781  None.
11782  Parameters:
11783  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11784  patternLen - Length of pattern match (either 1 or 2)
11785  Returns:
11786  None.
11787  Example:
11788  <code>
11789  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11790  DMA_PATTERN_LENGTH patternLen;
11791  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
11792  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
11793  </code>
11794  Remarks:
11795  This function implements an operation of the ChannelXPatternLength feature.
11796  This feature may not be available on all devices. Please refer to the
11797  specific device data sheet to determine availability or use the
11798  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11799  determine whether this feature is available.
11800 */
11801 
11802 void
11804  DMA_MODULE_ID index ,
11805  DMA_CHANNEL dmaChannel ,
11806  DMA_PATTERN_LENGTH patternLen ) ;
11807 //******************************************************************************
11808 /* Function:
11809  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
11810  DMA_CHANNEL dmaChannel);
11811  Summary:
11812  Returns the pattern match length.
11813  Description:
11814  This function returns the length of the byte matching the CHPIGN bits during a
11815  pattern match that may be ignored during the pattern match determination when
11816  the CHPIGNEN bit is set.
11817  Precondition:
11818  None.
11819  Parameters:
11820  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11821  Returns:
11822  - patternLen - Length of pattern match (either 1 or 2)
11823  Example:
11824  <code>
11825  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11826  DMA_PATTERN_LENGTH patternLen;
11827  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
11828  </code>
11829  Remarks:
11830  This function implements an operation of the ChannelXPatternLength feature.
11831  This feature may not be available on all devices. Please refer to the
11832  specific device data sheet to determine availability or use the
11833  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11834  determine whether this feature is available.
11835 */
11836 
11837 DMA_PATTERN_LENGTH
11839  DMA_MODULE_ID index ,
11840  DMA_CHANNEL dmaChannel ) ;
11841 //******************************************************************************
11842 /* Function:
11843  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
11844  DMA_CHANNEL channel );
11845  Summary:
11846  Enables the pattern match ignore byte.
11847  Description:
11848  This function enables the pattern match ignore byte.
11849  Precondition:
11850  None.
11851  Parameters:
11852  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11853  Returns:
11854  None.
11855  Example:
11856  <code>
11857  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11858  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
11859  </code>
11860  Remarks:
11861  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11862  This feature may not be available on all devices. Please refer to the
11863  specific device data sheet to determine availability or use the
11864  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11865  determine whether this feature is available.
11866 */
11867 
11868 void
11870  DMA_MODULE_ID index ,
11871  DMA_CHANNEL channel ) ;
11872 //******************************************************************************
11873 /* Function:
11874  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
11875  DMA_CHANNEL channel );
11876  Summary:
11877  Returns the state of the pattern match ignore byte.
11878  Description:
11879  This function returns the state (enabled or disabled) of the pattern match
11880  ignore byte.
11881  Precondition:
11882  None.
11883  Parameters:
11884  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11885  Returns:
11886  - true - The pattern match ignore byte is enabled
11887  - false - The pattern match ignore byte is disabled
11888  Example:
11889  <code>
11890  bool patternIsEnabled;
11891  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11892  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
11893  </code>
11894  Remarks:
11895  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11896  This feature may not be available on all devices. Please refer to the
11897  specific device data sheet to determine availability or use the
11898  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11899  determine whether this feature is available.
11900 */
11901 
11902 bool
11904  DMA_MODULE_ID index ,
11905  DMA_CHANNEL channel ) ;
11906 //******************************************************************************
11907 /* Function:
11908  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
11909  DMA_CHANNEL channel );
11910  Summary:
11911  Disables the pattern match ignore byte.
11912  Description:
11913  This function disables the pattern match ignore byte.
11914  Precondition:
11915  None.
11916  Parameters:
11917  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11918  Returns:
11919  None.
11920  Example:
11921  <code>
11922  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11923  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
11924  </code>
11925  Remarks:
11926  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11927  This feature may not be available on all devices. Please refer to the
11928  specific device data sheet to determine availability or use the
11929  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11930  determine whether this feature is available.
11931 */
11932 
11933 void
11935  DMA_MODULE_ID index ,
11936  DMA_CHANNEL channel ) ;
11937 //******************************************************************************
11938 /* Function:
11939  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
11940  DMA_CHANNEL channel, uint8_t pattern );
11941  Summary:
11942  Sets the pattern match ignore value.
11943  Description:
11944  This function sets the value of the pattern match ignore.
11945  Precondition:
11946  None.
11947  Parameters:
11948  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11949  pattern - Pattern match ignore value
11950  Returns:
11951  None.
11952  Example:
11953  <code>
11954  uint8_t patternMatch = 0x8;
11955  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11956  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
11957  </code>
11958  Remarks:
11959  This function implements an operation of the ChannelXPatternIgnore feature.
11960  This feature may not be available on all devices. Please refer to the
11961  specific device data sheet to determine availability or use the
11962  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
11963  determine whether this feature is available.
11964 */
11965 
11966 void
11968  DMA_MODULE_ID index ,
11969  DMA_CHANNEL channel ,
11970  uint8_t pattern ) ;
11971 //******************************************************************************
11972 /* Function:
11973  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
11974  DMA_CHANNEL channel );
11975  Summary:
11976  Returns the pattern match ignore value.
11977  Description:
11978  This function returns the value of the pattern match ignore.
11979  Precondition:
11980  None.
11981  Parameters:
11982  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11983  Returns:
11984  - uint8_t - Pattern match ignore value
11985  Example:
11986  <code>
11987  uint8_t patternMatch;
11988  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11989  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
11990  </code>
11991  Remarks:
11992  This function implements an operation of the ChannelXPatternIgnore feature.
11993  This feature may not be available on all devices. Please refer to the
11994  specific device data sheet to determine availability or use the
11995  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
11996  determine whether this feature is available.
11997 */
11998 
11999 uint8_t
12001  DMA_MODULE_ID index ,
12002  DMA_CHANNEL channel ) ;
12003 // *****************************************************************************
12004 // *****************************************************************************
12005 // Section: DMA Peripheral Library Exists API Routines
12006 // *****************************************************************************
12007 // *****************************************************************************
12008 /* The following functions indicate the existence of the features on the device.
12009 */
12010 //******************************************************************************
12011 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12012  Summary:
12013  Identifies whether the Busy feature exists on the DMA module.
12014  Description:
12015  This function identifies whether the Busy feature is available on the
12016  DMA module.
12017  When this function returns true, these functions are supported on the device:
12018  - PLIB_DMA_BusyActiveSet
12019  - PLIB_DMA_BusyActiveReset
12020  - PLIB_DMA_IsBusy
12021  Preconditions:
12022  None.
12023  Parameters:
12024  index - Identifier for the device instance
12025  Returns:
12026  - true - The Busy feature is supported on the device
12027  - false - The Busy feature is not supported on the device
12028  Remarks:
12029  None.
12030 */
12031 
12032 bool
12034  DMA_MODULE_ID index ) ;
12035 //******************************************************************************
12036 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12037  Summary:
12038  Identifies whether the Suspend feature exists on the DMA module.
12039  Description:
12040  This function identifies whether the Suspend feature is available on the
12041  DMA module.
12042  When this function returns true, these functions are supported on the device:
12043  - PLIB_DMA_SuspendEnable
12044  - PLIB_DMA_SuspendDisable
12045  - PLIB_DMA_SuspendIsEnabled
12046  Preconditions:
12047  None.
12048  Parameters:
12049  index - Identifier for the device instance
12050  Returns:
12051  - true - The Suspend feature is supported on the device
12052  - false - The Suspend feature is not supported on the device
12053  Remarks:
12054  None.
12055 */
12056 
12057 bool
12059  DMA_MODULE_ID index ) ;
12060 //******************************************************************************
12061 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12062  Summary:
12063  Identifies whether the StopInIdle feature exists on the DMA module.
12064  Description:
12065  This function identifies whether the StopInIdle feature is available on the
12066  DMA module.
12067  When this function returns true, these functions are supported on the device:
12068  - PLIB_DMA_StopInIdleEnable
12069  - PLIB_DMA_StopInIdleDisable
12070  Preconditions:
12071  None.
12072  Parameters:
12073  index - Identifier for the device instance
12074  Returns:
12075  - true - The StopInIdle feature is supported on the device
12076  - false - The StopInIdle feature is not supported on the device
12077  Remarks:
12078  None.
12079 */
12080 
12081 bool
12083  DMA_MODULE_ID index ) ;
12084 //******************************************************************************
12085 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12086  Summary:
12087  Identifies whether the EnableControl feature exists on the DMA module.
12088  Description:
12089  This function identifies whether the EnableControl feature is available on
12090  the DMA module.
12091  When this function returns true, these functions are supported on the device:
12092  - PLIB_DMA_Enable
12093  - PLIB_DMA_Disable
12094  - PLIB_DMA_IsEnabled
12095  Preconditions:
12096  None.
12097  Parameters:
12098  index - Identifier for the device instance
12099  Returns:
12100  - true - The EnableControl feature is supported on the device
12101  - false - The EnableControl feature is not supported on the device
12102  Remarks:
12103  None.
12104 */
12105 
12106 bool
12108  DMA_MODULE_ID index ) ;
12109 //******************************************************************************
12110 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12111  Summary:
12112  Identifies whether the ChannelBits feature exists on the DMA module.
12113  Description:
12114  This function identifies whether the ChannelBits feature is available on the
12115  DMA module.
12116  When this function returns true, this function is supported on the device:
12117  - PLIB_DMA_ChannelBitsGet
12118  Preconditions:
12119  None.
12120  Parameters:
12121  index - Identifier for the device instance
12122  Returns:
12123  - true - The ChannelBits feature is supported on the device
12124  - false - The ChannelBits feature is not supported on the device
12125  Remarks:
12126  None.
12127 */
12128 
12129 bool
12131  DMA_MODULE_ID index ) ;
12132 //******************************************************************************
12133 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12134  Summary:
12135  Identifies whether the LastBusAccess feature exists on the DMA module.
12136  Description:
12137  This function identifies whether the LastBusAccess feature is available on the
12138  DMA module.
12139  When this function returns true, these functions are supported on the device:
12140  - PLIB_DMA_LastBusAccessIsRead
12141  - PLIB_DMA_LastBusAccessIsWrite
12142  Preconditions:
12143  None.
12144  Parameters:
12145  index - Identifier for the device instance
12146  Returns:
12147  - true - The LastBusAccess feature is supported on the device
12148  - false - The LastBusAccess feature is not supported on the device
12149  Remarks:
12150  None.
12151 */
12152 
12153 bool
12155  DMA_MODULE_ID index ) ;
12156 //******************************************************************************
12157 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12158  Summary:
12159  Identifies whether the RecentAddress feature exists on the DMA module.
12160  Description:
12161  This function identifies whether the RecentAddress feature is available on
12162  the DMA module.
12163  When this function returns true, this function is supported on the device:
12164  - PLIB_DMA_RecentAddressAccessed
12165  Preconditions:
12166  None.
12167  Parameters:
12168  index - Identifier for the device instance
12169  Returns:
12170  - true - The RecentAddress feature is supported on the device
12171  - false - The RecentAddress feature is not supported on the device
12172  Remarks:
12173  None.
12174 */
12175 
12176 bool
12178  DMA_MODULE_ID index ) ;
12179 //******************************************************************************
12180 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12181  Summary:
12182  Identifies whether the CRCChannel feature exists on the DMA module.
12183  Description:
12184  This function identifies whether the CRCChannel feature is available on the
12185  DMA module.
12186  When this function returns true, these functions are supported on the device:
12187  - PLIB_DMA_CRCChannelSelect
12188  - PLIB_DMA_CRCChannelGet
12189  Preconditions:
12190  None.
12191  Parameters:
12192  index - Identifier for the device instance
12193  Returns:
12194  - true - The CRCChannel feature is supported on the device
12195  - false - The CRCChannel feature is not supported on the device
12196  Remarks:
12197  None.
12198 */
12199 
12200 bool
12202  DMA_MODULE_ID index ) ;
12203 //******************************************************************************
12204 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12205  Summary:
12206  Identifies whether the CRCType feature exists on the DMA module.
12207  Description:
12208  This function identifies whether the CRCType feature is available on the
12209  DMA module.
12210  When this function returns true, these functions are supported on the device:
12211  - PLIB_DMA_CRCTypeGet
12212  - PLIB_DMA_CRCTypeSet
12213  Preconditions:
12214  None.
12215  Parameters:
12216  index - Identifier for the device instance
12217  Returns:
12218  - true - The CRCType feature is supported on the device
12219  - false - The CRCType feature is not supported on the device
12220  Remarks:
12221  None.
12222 */
12223 
12224 bool
12226  DMA_MODULE_ID index ) ;
12227 //******************************************************************************
12228 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12229  Summary:
12230  Identifies whether the CRCAppendMode feature exists on the DMA module.
12231  Description:
12232  This function identifies whether the CRCAppendMode feature is available on
12233  the DMA module.
12234  When this function returns true, these functions are supported on the device:
12235  - PLIB_DMA_CRCAppendModeEnable
12236  - PLIB_DMA_CRCAppendModeDisable
12237  - PLIB_DMA_CRCAppendModeIsEnabled
12238  Preconditions:
12239  None.
12240  Parameters:
12241  index - Identifier for the device instance
12242  Returns:
12243  - true - The CRCAppendMode feature is supported on the device
12244  - false - The CRCAppendMode feature is not supported on the device
12245  Remarks:
12246  None.
12247 */
12248 
12249 bool
12251  DMA_MODULE_ID index ) ;
12252 //******************************************************************************
12253 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12254  Summary:
12255  Identifies whether the CRC feature exists on the DMA module.
12256  Description:
12257  This function identifies whether the CRC feature is available on the DMA module.
12258  When this function returns true, these functions are supported on the device:
12259  - PLIB_DMA_CRCEnable
12260  - PLIB_DMA_CRCDisable
12261  - PLIB_DMA_CRCIsEnabled
12262  Preconditions:
12263  None.
12264  Parameters:
12265  index - Identifier for the device instance
12266  Returns:
12267  - true - The CRC feature is supported on the device
12268  - false - The CRC feature is not supported on the device
12269  Remarks:
12270  None.
12271 */
12272 
12273 bool
12275  DMA_MODULE_ID index ) ;
12276 //******************************************************************************
12277 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12278  Summary:
12279  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12280  Description:
12281  This function identifies whether the CRCPolynomialLength feature is available
12282  on the DMA module.
12283  When this function returns true, these functions are supported on the device:
12284  - PLIB_DMA_CRCPolynomialLengthSet
12285  - PLIB_DMA_CRCPolynomialLengthGet
12286  Preconditions:
12287  None.
12288  Parameters:
12289  index - Identifier for the device instance
12290  Returns:
12291  - true - The CRCPolynomialLength feature is supported on the device
12292  - false - The CRCPolynomialLength feature is not supported on the device
12293  Remarks:
12294  None.
12295 */
12296 
12297 bool
12299  DMA_MODULE_ID index ) ;
12300 //******************************************************************************
12301 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12302  Summary:
12303  Identifies whether the CRCBitOrder feature exists on the DMA module.
12304  Description:
12305  This function identifies whether the CRCBitOrder feature is available on the
12306  DMA module.
12307  When this function returns true, this function is supported on the device:
12308  - PLIB_DMA_CRCBitOrderSelect
12309  Preconditions:
12310  None.
12311  Parameters:
12312  index - Identifier for the device instance
12313  Returns:
12314  - true - The CRCBitOrder feature is supported on the device
12315  - false - The CRCBitOrder feature is not supported on the device
12316  Remarks:
12317  None.
12318 */
12319 
12320 bool
12322  DMA_MODULE_ID index ) ;
12323 //******************************************************************************
12324 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12325  Summary:
12326  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12327  Description:
12328  This function identifies whether the CRCWriteByteOrder feature is available
12329  on the DMA module.
12330  When this function returns true, these functions are supported on the device:
12331  - PLIB_DMA_CRCWriteByteOrderAlter
12332  - PLIB_DMA_CRCWriteByteOrderMaintain
12333  Preconditions:
12334  None.
12335  Parameters:
12336  index - Identifier for the device instance
12337  Returns:
12338  - true - The CRCWriteByteOrder feature is supported on the device
12339  - false - The CRCWriteByteOrder feature is not supported on the device
12340  Remarks:
12341  None.
12342 */
12343 
12344 bool
12346  DMA_MODULE_ID index ) ;
12347 //******************************************************************************
12348 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12349  Summary:
12350  Identifies whether the CRCByteOrder feature exists on the DMA module.
12351  Description:
12352  This function identifies whether the CRCByteOrder feature is available on
12353  the DMA module.
12354  When this function returns true, these functions are supported on the device:
12355  - PLIB_DMA_CRCByteOrderSelect
12356  - PLIB_DMA_CRCByteOrderGet
12357  Preconditions:
12358  None.
12359  Parameters:
12360  index - Identifier for the device instance
12361  Returns:
12362  - true - The CRCByteOrder feature is supported on the device
12363  - false - The CRCByteOrder feature is not supported on the device
12364  Remarks:
12365  None.
12366 */
12367 
12368 bool
12370  DMA_MODULE_ID index ) ;
12371 //******************************************************************************
12372 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12373  Summary:
12374  Identifies whether the CRCData feature exists on the DMA module.
12375  Description:
12376  This function identifies whether the CRCData feature is available on the
12377  DMA module.
12378  When this function returns true, these functions are supported on the device:
12379  - PLIB_DMA_CRCDataRead
12380  - PLIB_DMA_CRCDataWrite
12381  Preconditions:
12382  None.
12383  Parameters:
12384  index - Identifier for the device instance
12385  Returns:
12386  - true - The CRCData feature is supported on the device
12387  - false - The CRCData feature is not supported on the device
12388  Remarks:
12389  None.
12390 */
12391 
12392 bool
12394  DMA_MODULE_ID index ) ;
12395 //******************************************************************************
12396 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12397  Summary:
12398  Identifies whether the CRCXOREnable feature exists on the DMA module.
12399  Description:
12400  This function identifies whether the CRCXOREnable feature is available on the
12401  DMA module.
12402  When this function returns true, these functions are supported on the device:
12403  - PLIB_DMA_CRCXOREnableSet
12404  - PLIB_DMA_CRCXOREnableGet
12405  Preconditions:
12406  None.
12407  Parameters:
12408  index - Identifier for the device instance
12409  Returns:
12410  - true - The CRCXOREnable feature is supported on the device
12411  - false - The CRCXOREnable feature is not supported on the device
12412  Remarks:
12413  None.
12414 */
12415 
12416 bool
12418  DMA_MODULE_ID index ) ;
12419 //******************************************************************************
12420 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12421  Summary:
12422  Identifies whether the ChannelXPriority feature exists on the DMA module.
12423  Description:
12424  This function identifies whether the ChannelXPriority feature is available on
12425  the DMA module.
12426  When this function returns true, these functions are supported on the device:
12427  - PLIB_DMA_ChannelXPrioritySelect
12428  - PLIB_DMA_ChannelXPriorityGet
12429  Preconditions:
12430  None.
12431  Parameters:
12432  index - Identifier for the device instance
12433  Returns:
12434  - true - The ChannelXPriority feature is supported on the device
12435  - false - The ChannelXPriority feature is not supported on the device
12436  Remarks:
12437  None.
12438 */
12439 
12440 bool
12442  DMA_MODULE_ID index ) ;
12443 //******************************************************************************
12444 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12445  Summary:
12446  Identifies whether the ChannelXEvent feature exists on the DMA module.
12447  Description:
12448  This function identifies whether the ChannelXEvent feature is available on
12449  the DMA module.
12450  When this function returns true, this function is supported on the device:
12451  - PLIB_DMA_ChannelXEventIsDetected
12452  Preconditions:
12453  None.
12454  Parameters:
12455  index - Identifier for the device instance
12456  Returns:
12457  - true - The ChannelXEvent feature is supported on the device
12458  - false - The ChannelXEvent feature is not supported on the device
12459  Remarks:
12460  None.
12461 */
12462 
12463 bool
12465  DMA_MODULE_ID index ) ;
12466 //******************************************************************************
12467 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12468  Summary:
12469  Identifies whether the ChannelXAuto feature exists on the DMA module.
12470  Description:
12471  This function identifies whether the ChannelXAuto feature is available on
12472  the DMA module.
12473  When this function returns true, these functions are supported on the device:
12474  - PLIB_DMA_ChannelXAutoEnable
12475  - PLIB_DMA_ChannelXAutoDisable
12476  - PLIB_DMA_ChannelXAutoIsEnabled
12477  Preconditions:
12478  None.
12479  Parameters:
12480  index - Identifier for the device instance
12481  Returns:
12482  - true - The ChannelXAuto feature is supported on the device
12483  - false - The ChannelXAuto feature is not supported on the device
12484  Remarks:
12485  None.
12486 */
12487 
12488 bool
12490  DMA_MODULE_ID index ) ;
12491 //******************************************************************************
12492 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12493  Summary:
12494  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12495  Description:
12496  This function identifies whether the ChannelXChainEnbl feature is available
12497  on the DMA module.
12498  When this function returns true, these functions are supported on the device:
12499  - PLIB_DMA_ChannelXChainEnable
12500  - PLIB_DMA_ChannelXChainDisable
12501  - PLIB_DMA_ChannelXChainIsEnabled
12502  Preconditions:
12503  None.
12504  Parameters:
12505  index - Identifier for the device instance
12506  Returns:
12507  - true - The ChannelXChainEnbl feature is supported on the device
12508  - false - The ChannelXChainEnbl feature is not supported on the device
12509  Remarks:
12510  None.
12511 */
12512 
12513 bool
12515  DMA_MODULE_ID index ) ;
12516 //******************************************************************************
12517 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12518  Summary:
12519  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12520  Description:
12521  This function identifies whether the ChannelXDisabled feature is available
12522  on the DMA module.
12523  When this function returns true, these functions are supported on the device:
12524  - PLIB_DMA_ChannelXDisabledEnablesEvents
12525  - PLIB_DMA_ChannelXDisabledDisablesEvents
12526  Preconditions:
12527  None.
12528  Parameters:
12529  index - Identifier for the device instance
12530  Returns:
12531  - true - The ChannelXDisabled feature is supported on the device
12532  - false - The ChannelXDisabled feature is not supported on the device
12533  Remarks:
12534  None.
12535 */
12536 
12537 bool
12539  DMA_MODULE_ID index ) ;
12540 //******************************************************************************
12541 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
12542  Summary:
12543  Identifies whether the ChannelX feature exists on the DMA module.
12544  Description:
12545  This function identifies whether the ChannelX feature is available on the
12546  DMA module.
12547  When this function returns true, these functions are supported on the device:
12548  - PLIB_DMA_ChannelXEnable
12549  - PLIB_DMA_ChannelXIsEnabled
12550  - PLIB_DMA_ChannelXDisable
12551  Preconditions:
12552  None.
12553  Parameters:
12554  index - Identifier for the device instance
12555  Returns:
12556  - true - The ChannelX feature is supported on the device
12557  - false - The ChannelX feature is not supported on the device
12558  Remarks:
12559  None.
12560 */
12561 
12562 bool
12564  DMA_MODULE_ID index ) ;
12565 //******************************************************************************
12566 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
12567  Summary:
12568  Identifies whether the ChannelXChain feature exists on the DMA module.
12569  Description:
12570  This function identifies whether the ChannelXChain feature is available on the
12571  DMA module.
12572  When this function returns true, these functions are supported on the device:
12573  - PLIB_DMA_ChannelXChainToLower
12574  - PLIB_DMA_ChannelXChainToHigher
12575  Preconditions:
12576  None.
12577  Parameters:
12578  index - Identifier for the device instance
12579  Returns:
12580  - true - The ChannelXChain feature is supported on the device
12581  - false - The ChannelXChain feature is not supported on the device
12582  Remarks:
12583  None.
12584 */
12585 
12586 bool
12588  DMA_MODULE_ID index ) ;
12589 //******************************************************************************
12590 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
12591  Summary:
12592  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
12593  Description:
12594  This function identifies whether the ChannelXPatternLength feature is available
12595  on the DMA module.
12596  When this function returns true, these functions are supported on the device:
12597  - PLIB_DMA_ChannelXPatternLengthSet
12598  - PLIB_DMA_ChannelXPatternLengthGet
12599  Preconditions:
12600  None.
12601  Parameters:
12602  index - Identifier for the device instance
12603  Returns:
12604  - true - The ChannelXPatternLength feature is supported on the device
12605  - false - The ChannelXPatternLength feature is not supported on the device
12606  Remarks:
12607  None.
12608 */
12609 
12610 bool
12612  DMA_MODULE_ID index ) ;
12613 //******************************************************************************
12614 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
12615  Summary:
12616  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
12617  module.
12618  Description:
12619  This function identifies whether the ChannelXPatternIgnoreByte feature is
12620  available on the DMA module.
12621  When this function returns true, these functions are supported on the device:
12622  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
12623  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
12624  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
12625  Preconditions:
12626  None.
12627  Parameters:
12628  index - Identifier for the device instance
12629  Returns:
12630  - true - The ChannelXPatternIgnoreByte feature is supported on the device
12631  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
12632  Remarks:
12633  None.
12634 */
12635 
12636 bool
12638  DMA_MODULE_ID index ) ;
12639 //******************************************************************************
12640 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
12641  Summary:
12642  Identifies whether the ChannelXBusy feature exists on the DMA module.
12643  Description:
12644  This function identifies whether the ChannelXBusy feature is available on the
12645  DMA module.
12646  When this function returns true, these functions are supported on the device:
12647  - PLIB_DMA_ChannelXBusyActiveSet
12648  - PLIB_DMA_ChannelXBusyInActiveSet
12649  - PLIB_DMA_ChannelXBusyIsBusy
12650  Preconditions:
12651  None.
12652  Parameters:
12653  index - Identifier for the device instance
12654  Returns:
12655  - true - The ChannelXBusy feature is supported on the device
12656  - false - The ChannelXBusy feature is not supported on the device
12657  Remarks:
12658  None.
12659 */
12660 
12661 bool
12663  DMA_MODULE_ID index ) ;
12664 //******************************************************************************
12665 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
12666  Summary:
12667  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
12668  Description:
12669  This function identifies whether the ChannelXPatternIgnore feature is available
12670  on the DMA module.
12671  When this function returns true, these functions are supported on the device:
12672  - PLIB_DMA_ChannelXPatternIgnoreSet
12673  - PLIB_DMA_ChannelXPatternIgnoreGet
12674  Preconditions:
12675  None.
12676  Parameters:
12677  index - Identifier for the device instance
12678  Returns:
12679  - true - The ChannelXPatternIgnore feature is supported on the device
12680  - false - The ChannelXPatternIgnore feature is not supported on the device
12681  Remarks:
12682  None.
12683 */
12684 
12685 bool
12687  DMA_MODULE_ID index ) ;
12688 //******************************************************************************
12689 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
12690  Summary:
12691  Identifies whether the ChannelXTrigger feature exists on the DMA module.
12692  Description:
12693  This function identifies whether the ChannelXTrigger feature is available on
12694  the DMA module.
12695  When this function returns true, these functions are supported on the device:
12696  - PLIB_DMA_ChannelXTriggerEnable
12697  - PLIB_DMA_ChannelXTriggerIsEnabled
12698  - PLIB_DMA_ChannelXTriggerDisable
12699  Preconditions:
12700  None.
12701  Parameters:
12702  index - Identifier for the device instance
12703  Returns:
12704  - true - The ChannelXTrigger feature is supported on the device
12705  - false - The ChannelXTrigger feature is not supported on the device
12706  Remarks:
12707  None.
12708 */
12709 
12710 bool
12712  DMA_MODULE_ID index ) ;
12713 //******************************************************************************
12714 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
12715  Summary:
12716  Identifies whether the AbortTransfer feature exists on the DMA module.
12717  Description:
12718  This function identifies whether the AbortTransfer feature is available on
12719  the DMA module.
12720  When this function returns true, this function is supported on the device:
12721  - PLIB_DMA_AbortTransferSet
12722  Preconditions:
12723  None.
12724  Parameters:
12725  index - Identifier for the device instance
12726  Returns:
12727  - true - The AbortTransfer feature is supported on the device
12728  - false - The AbortTransfer feature is not supported on the device
12729  Remarks:
12730  None.
12731 */
12732 
12733 bool
12735  DMA_MODULE_ID index ) ;
12736 //******************************************************************************
12737 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
12738  Summary:
12739  Identifies whether the StartTransfer feature exists on the DMA module.
12740  Description:
12741  This function identifies whether the StartTransfer feature is available on
12742  the DMA module.
12743  When this function returns true, this function is supported on the device:
12744  - PLIB_DMA_StartTransferSet
12745  Preconditions:
12746  None.
12747  Parameters:
12748  index - Identifier for the device instance
12749  Returns:
12750  - true - The StartTransfer feature is supported on the device
12751  - false - The StartTransfer feature is not supported on the device
12752  Remarks:
12753  None.
12754 */
12755 
12756 bool
12758  DMA_MODULE_ID index ) ;
12759 //******************************************************************************
12760 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
12761  Summary:
12762  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
12763  Description:
12764  This function identifies whether the ChannelXStartIRQ feature is available
12765  on the DMA module.
12766  When this function returns true, this function is supported on the device:
12767  - PLIB_DMA_ChannelXStartIRQSet
12768  Preconditions:
12769  None.
12770  Parameters:
12771  index - Identifier for the device instance
12772  Returns:
12773  - true - The ChannelXStartIRQ feature is supported on the device
12774  - false - The ChannelXStartIRQ feature is not supported on the device
12775  Remarks:
12776  None.
12777 */
12778 
12779 bool
12781  DMA_MODULE_ID index ) ;
12782 //******************************************************************************
12783 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
12784  Summary:
12785  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
12786  Description:
12787  This function identifies whether the ChannelXAbortIRQ feature is available
12788  on the DMA module.
12789  When this function returns true, this function is supported on the device:
12790  - PLIB_DMA_ChannelXAbortIRQSet
12791  Preconditions:
12792  None.
12793  Parameters:
12794  index - Identifier for the device instance
12795  Returns:
12796  - true - The ChannelXAbortIRQ feature is supported on the device
12797  - false - The ChannelXAbortIRQ feature is not supported on the device
12798  Remarks:
12799  None.
12800 */
12801 
12802 bool
12804  DMA_MODULE_ID index ) ;
12805 //******************************************************************************
12806 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
12807  Summary:
12808  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
12809  Description:
12810  This function identifies whether the ChannelXINTSourceFlag feature is available
12811  on the DMA module.
12812  When this function returns true, these functions are supported on the device:
12813  - PLIB_DMA_ChannelXINTSourceFlagGet
12814  - PLIB_DMA_ChannelXINTSourceFlagSet
12815  - PLIB_DMA_ChannelXINTSourceFlagClear
12816  Preconditions:
12817  None.
12818  Parameters:
12819  index - Identifier for the device instance
12820  Returns:
12821  - true - The ChannelXINTSourceFlag feature is supported on the device
12822  - false - The ChannelXINTSourceFlag feature is not supported on the device
12823  Remarks:
12824  None.
12825 */
12826 
12827 bool
12829  DMA_MODULE_ID index ) ;
12830 //******************************************************************************
12831 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
12832  Summary:
12833  Identifies whether the ChannelXINTSource feature exists on the DMA module.
12834  Description:
12835  This function identifies whether the ChannelXINTSource feature is available
12836  on the DMA module.
12837  When this function returns true, these functions are supported on the device:
12838  - PLIB_DMA_ChannelXINTSourceEnable
12839  - PLIB_DMA_ChannelXINTSourceDisable
12840  - PLIB_DMA_ChannelXINTSourceIsEnabled
12841  Preconditions:
12842  None.
12843  Parameters:
12844  index - Identifier for the device instance
12845  Returns:
12846  - true - The ChannelXINTSource feature is supported on the device
12847  - false - The ChannelXINTSource feature is not supported on the device
12848  Remarks:
12849  None.
12850 */
12851 
12852 bool
12854  DMA_MODULE_ID index ) ;
12855 //******************************************************************************
12856 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
12857  Summary:
12858  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
12859  Description:
12860  This function identifies whether the ChannelXSourceStartAddress feature is available
12861  on the DMA module.
12862  When this function returns true, these functions are supported on the device:
12863  - PLIB_DMA_ChannelXSourceStartAddressGet
12864  - PLIB_DMA_ChannelXSourceStartAddressSet
12865  Preconditions:
12866  None.
12867  Parameters:
12868  index - Identifier for the device instance
12869  Returns:
12870  - true - The ChannelXSourceStartAddress feature is supported on the device
12871  - false - The ChannelXSourceStartAddress feature is not supported on the device
12872  Remarks:
12873  None.
12874 */
12875 
12876 bool
12878  DMA_MODULE_ID index ) ;
12879 //******************************************************************************
12880 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
12881  Summary:
12882  Identifies whether the ChannelXDestinationStartAddress feature exists on
12883  the DMA module.
12884  Description:
12885  This function identifies whether the ChannelXDestinationStartAddress feature
12886  is available on the DMA module.
12887  When this function returns true, these functions are supported on the device:
12888  - PLIB_DMA_ChannelXDestinationStartAddressGet
12889  - PLIB_DMA_ChannelXDestinationStartAddressSet
12890  Preconditions:
12891  None.
12892  Parameters:
12893  index - Identifier for the device instance
12894  Returns:
12895  - true - The ChannelXDestinationStartAddress feature is supported on the device
12896  - false - The ChannelXDestinationStartAddress feature is not supported on the device
12897  Remarks:
12898  None.
12899 */
12900 
12901 bool
12903  DMA_MODULE_ID index ) ;
12904 //******************************************************************************
12905 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
12906  Summary:
12907  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
12908  Description:
12909  This function identifies whether the ChannelXSourceSize feature is available
12910  on the DMA module.
12911  When this function returns true, these functions are supported on the device:
12912  - PLIB_DMA_ChannelXSourceSizeGet
12913  - PLIB_DMA_ChannelXSourceSizeSet
12914  Preconditions:
12915  None.
12916  Parameters:
12917  index - Identifier for the device instance
12918  Returns:
12919  - true - The ChannelXSourceSize feature is supported on the device
12920  - false - The ChannelXSourceSize feature is not supported on the device
12921  Remarks:
12922  None.
12923 */
12924 
12925 bool
12927  DMA_MODULE_ID index ) ;
12928 //******************************************************************************
12929 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
12930  Summary:
12931  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
12932  Description:
12933  This function identifies whether the ChannelXDestinationSize feature is available
12934  on the DMA module.
12935  When this function returns true, these functions are supported on the device:
12936  - PLIB_DMA_ChannelXDestinationSizeGet
12937  - PLIB_DMA_ChannelXDestinationSizeSet
12938  Preconditions:
12939  None.
12940  Parameters:
12941  index - Identifier for the device instance
12942  Returns:
12943  - true - The ChannelXDestinationSize feature is supported on the device
12944  - false - The ChannelXDestinationSize feature is not supported on the device
12945  Remarks:
12946  None.
12947 */
12948 
12949 bool
12951  DMA_MODULE_ID index ) ;
12952 //******************************************************************************
12953 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
12954  Summary:
12955  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
12956  Description:
12957  This function identifies whether the ChannelXSourcePointer feature is available
12958  on the DMA module.
12959  When this function returns true, this function is supported on the device:
12960  - PLIB_DMA_ChannelXSourcePointerGet
12961  Preconditions:
12962  None.
12963  Parameters:
12964  index - Identifier for the device instance
12965  Returns:
12966  - true - The ChannelXSourcePointer feature is supported on the device
12967  - false - The ChannelXSourcePointer feature is not supported on the device
12968  Remarks:
12969  None.
12970 */
12971 
12972 bool
12974  DMA_MODULE_ID index ) ;
12975 //******************************************************************************
12976 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
12977  Summary:
12978  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
12979  Description:
12980  This function identifies whether the ChannelXDestinationPointer feature is available
12981  on the DMA module.
12982  When this function returns true, this function is supported on the device:
12983  - PLIB_DMA_ChannelXDestinationPointerGet
12984  Preconditions:
12985  None.
12986  Parameters:
12987  index - Identifier for the device instance
12988  Returns:
12989  - true - The ChannelXDestinationPointer feature is supported on the device
12990  - false - The ChannelXDestinationPointer feature is not supported on the device
12991  Remarks:
12992  None.
12993 */
12994 
12995 bool
12997  DMA_MODULE_ID index ) ;
12998 //******************************************************************************
12999 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13000  Summary:
13001  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13002  Description:
13003  This function identifies whether the ChannelXCellSize feature is available on
13004  the DMA module.
13005  When this function returns true, these functions are supported on the device:
13006  - PLIB_DMA_ChannelXCellSizeGet
13007  - PLIB_DMA_ChannelXCellSizeSet
13008  Preconditions:
13009  None.
13010  Parameters:
13011  index - Identifier for the device instance
13012  Returns:
13013  - true - The ChannelXCellSize feature is supported on the device
13014  - false - The ChannelXCellSize feature is not supported on the device
13015  Remarks:
13016  None.
13017 */
13018 
13019 bool
13021  DMA_MODULE_ID index ) ;
13022 //******************************************************************************
13023 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13024  Summary:
13025  Identifies whether the ChannelXCellProgressPointer feature exists on the
13026  DMA module.
13027  Description:
13028  This function identifies whether the ChannelXCellProgressPointer feature is
13029  available on the DMA module.
13030  When this function returns true, this function is supported on the device:
13031  - PLIB_DMA_ChannelXCellProgressPointerGet
13032  Preconditions:
13033  None.
13034  Parameters:
13035  index - Identifier for the device instance
13036  Returns:
13037  - true - The ChannelXCellProgressPointer feature is supported on the device
13038  - false - The ChannelXCellProgressPointer feature is not supported on the device
13039  Remarks:
13040  None.
13041 */
13042 
13043 bool
13045  DMA_MODULE_ID index ) ;
13046 //******************************************************************************
13047 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13048  Summary:
13049  Identifies whether the ChannelXPatternData feature exists on the DMA module
13050  Description:
13051  This function identifies whether the ChannelXPatternData feature is available
13052  on the DMA module.
13053  When this function returns true, these functions are supported on the device:
13054  - PLIB_DMA_ChannelXPatternDataGet
13055  - PLIB_DMA_ChannelXPatternDataSet
13056  Preconditions:
13057  None.
13058  Parameters:
13059  index - Identifier for the device instance
13060  Returns:
13061  - true - The ChannelXPatternData feature is supported on the device
13062  - false - The ChannelXPatternData feature is not supported on the device
13063  Remarks:
13064  None.
13065 */
13066 
13067 bool
13069  DMA_MODULE_ID index ) ;
13070 //DOM-IGNORE-BEGIN
13071 //DOM-IGNORE-END
13072  // #ifndef _PLIB_DMA_H
13073 /*******************************************************************************
13074  End of File
13075 */
13076 
13077 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13078 /* CLOSE_FILE Include File */
13079 
13080 // *****************************************************************************
13081 // *****************************************************************************
13082 // Section: Data Types
13083 // *****************************************************************************
13084 // *****************************************************************************
13085 // *****************************************************************************
13086 /* DMA System Service Channel None
13087  Summary:
13088  DMA channel none
13089  Description:
13090  This constant identifies the specification of no choice from client
13091  for allocating a particular DMA channel.
13092  Remarks:
13093  This constant should be used in place of hard-coded numeric literals.
13094 */
13095 //DOM-IGNORE-BEGIN
13096 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13097 //DOM-IGNORE-END
13098 // *****************************************************************************
13099 /* DMA System Service Channel Any
13100  Summary:
13101  Identifies the client specification to allocate any available DMA channel.
13102  Description:
13103  This constant identifies the specification by the client
13104  to allocate any available DMA channel.
13105  Remarks:
13106  This constant should be used in place of hard-coded numeric literals.
13107 */
13108 //DOM-IGNORE-BEGIN
13109 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13110 //DOM-IGNORE-END
13111 // *****************************************************************************
13112 /* DMA System Service Channel Count
13113  Summary:
13114  Identifies the maximum number of DMA channel handles to be defined.
13115  Description:
13116  This constant identifies the maximum number of DMA channel handles
13117  that should be defined.
13118  Remarks:
13119  This value is derived from device-specific header files defined as
13120  part of the peripheral libraries.
13121 */
13122 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13123 // *****************************************************************************
13124 /* DMA System Service Channel Handle
13125  Summary:
13126  Assigns the handle for requested channel.
13127  Description:
13128  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13129  function. This handle is associated with the channel number that is used for
13130  data transfer and it allows the application to track the data transfer.
13131  The channel handle once assigned to a client expires when the
13132  client calls SYS_DMA_ChannelRelease.
13133  exits.
13134  Remarks:
13135  None.
13136 */
13137 
13138 typedef
13139 uintptr_t
13141 // *****************************************************************************
13142 /* DMA System Service Invalid Channel Handle
13143  Summary:
13144  Defines an invalid channel handle.
13145  Description:
13146  This is the definition of an invalid channel handle. An invalid buffer handle
13147  is returned by SYS_DMA_ChannelAllocate function if the channel number
13148  request was not successful.
13149  Remarks:
13150  None.
13151 */
13152 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13153 // *****************************************************************************
13154 /* DMA stop in idle mode
13155  Summary:
13156  Enable/Disable DMA operations in Idle mode.
13157  Description:
13158  This data type allows enabling/disabling of DMA operations in idle mode.
13159  Remarks:
13160  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13161  while initializing the DMA module by calling SYS_DMA_Initialize.
13162  This feature may not be available on all devices. Refer to the specific device
13163  data sheet to determine availability.
13164 */
13165 
13166 typedef
13167  enum
13168  {
13169  /* When the CPU enters idle mode, the DMA module continue operations */
13171  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13173  } SYS_DMA_SIDL ;
13174 // *****************************************************************************
13175 /* DMA Channel chaining priority
13176  Summary:
13177  Identifies the priority of chaining channel.
13178  Description:
13179  This data type identifies the priority of chaining channel.
13180  Channel chaining priority identifies the channel that will be enabled
13181  on completion of block data transfer on the master channel.
13182  Remarks:
13183  None.
13184 */
13185 
13186 typedef
13187  enum
13188  {
13189  /* Chain to channel higher in natural priority */
13191  /* Chain to channel lower in natural priority */
13194 // *****************************************************************************
13195 /* DMA Channel ignore pattern match
13196  Summary:
13197  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13198  pattern.
13199  Description:
13200  This data type allows enabling/disabling the feature to ignore a byte
13201  between a 2-byte match abort pattern.
13202  Remarks:
13203  This feature may not be available on all devices. Refer to the specific device
13204  data sheet to determine availability.
13205 */
13206 
13207 typedef
13208  enum
13209  {
13210  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13212  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13215 // *****************************************************************************
13216 /* DMA channel CRC mode
13217  Summary:
13218  Identifies the operation mode of the CRC module.
13219  Description:
13220  This data type identifies CRC operating mode. The CRC computation can be
13221  in background mode or append mode.
13222  Remarks:
13223  None.
13224 */
13225 
13226 typedef
13227  enum
13228  {
13229  /* DMA reads the data from the source, passes it through the CRC module and
13230  writes it to the destination. the calculated CRC is left in the DCRCDATA
13231  register at the end of the block transfer. */
13233  /* DMA only feeds source data to the CRC module. it does not write source data
13234  to the destination address. When a block transfer complete or pattern abort
13235  event occur, The DMA writes the CRC value to the destination address */
13238 // *****************************************************************************
13239 /* DMA channel CRC write order
13240  Summary:
13241  Identifies altering/maintaining write order post CRC computation.
13242  Description:
13243  This data type identifies write byte order selection post CRC
13244  computation.
13245  Remarks:
13246  None.
13247 */
13248 
13249 typedef
13250  enum
13251  {
13252  /* Source data is written to the destination unchanged regardless
13253  of the selected pre-CRC byte order. */
13255  /* Source data is written to the destination reordered according
13256  to the selected pre-CRC byte order. */
13259 // *****************************************************************************
13260 /* DMA channel operation modes
13261  Summary:
13262  Identifies the available DMA operating modes.
13263  Description:
13264  This data type Identifies the available DMA operating modes.
13265  The supported DMA modes are not mutually exclusive, but can be simultaneously
13266  operational.
13267  Remarks:
13268  These supported DMA modes can be logically OR'd together. They are passed
13269  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13270 */
13271 
13272 typedef
13273  enum
13274  {
13275  /* The normal DMA operation mode. The DMA channel will transfer data from
13276  a source to a destination without CPU intervention */
13277  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13278  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13279  ,
13280  /* Pattern Match abort mode allows the user to end a transfer if data
13281  written during a transaction matches a specific pattern, as defined by
13282  the DCHxDAT register */
13284  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13285  ,
13286  /* Channel chaining operating mode enhances the normal DMA channel
13287  operations. A channel(slave) can be chained to an adjacent channel(master).
13288  The slave channel will be enabled when a block transfer of the master
13289  channel completes. */
13290  /* only one of the below two chaining priorities must be provided.
13291  Chaining priority High. */
13293  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13294  ,
13295  /* Chaining priority Low */
13297  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13298  ,
13299  /* Auto enable operating mode allows a channel to be kept active, even if a
13300  block transfer completes or pattern match occurs. This prevents the user
13301  from having to re-enable the channel each time a block transfer completes. */
13302  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13303  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13304  ,
13305  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13306  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13307  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13309 // *****************************************************************************
13310 /* DMA channel CRC mode
13311  Summary:
13312  Defines the attributes for CRC operation mode.
13313  Description:
13314  This data type defines the attributes for CRC operation mode.
13315  Remarks:
13316  This feature may not be available on all devices. Refer to the specific device
13317  data sheet to determine availability.
13318 */
13319 
13320 typedef
13321  struct
13322  {
13323  /* CRC type (PLIB-level).
13324  Type Selection identifies whether the CRC module will calculate an IP
13325  header checksum or an LFSR CRC */
13326  DMA_CRC_TYPE type ;
13327  /* CRC mode, Background or Append */
13329  /* Polynomial length, This value is redundant when the selected CRC type is
13330  IP header checksum. When the CRC type is LFSR, Identifies the length of
13331  the polynomial. */
13332  uint8_t polyLength ;
13333  /* Bit order (PLIB-level).
13334  Identifies whether the CRC is computed LSb or MSb first */
13335  DMA_CRC_BIT_ORDER bitOrder ;
13336  /* Byte order (PLIB-level).
13337  Identifies the byte selection order input pre-CRC Generator. */
13338  DMA_CRC_BYTE_ORDER byteOrder ;
13339  /* Post CRC Write order */
13340  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13341  /* CRC data feed: While enabling the CRC mode, this field gives
13342  the seed for the CRC computation. On block transfer complete or
13343  pattern match abort the field have the computed CRC. */
13344  uint32_t data ;
13345  /* XOR bit mask, This value is redundant when the selected CRC type is
13346  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13347  bit mask input to the shift register during CRC computation. */
13348  uint32_t xorBitMask ;
13350 // *****************************************************************************
13351 /* DMA System service Events
13352  Summary:
13353  Enumeration of possible DMA System service events.
13354  Description:
13355  This data type provides an enumeration of all possible DMA System service events.
13356  Remarks:
13357  None.
13358 */
13359 
13360 typedef
13361  enum
13362  {
13363  /* Data was transferred successfully. */
13365  /* Error while processing the request */
13367  /* Data transfer was aborted. */
13369  /* No events yet. */
13372 // *****************************************************************************
13373 /* DMA System service Error
13374  Summary:
13375  Indicates the error information for the DMA System service.
13376  Description:
13377  This enumeration indicates the error information for the DMA System service.
13378  Remarks:
13379  None.
13380 */
13381 
13382 typedef
13383  enum
13384  {
13385  /* Data was transferred successfully. */
13386  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13387  = 1 << 0 ,
13388  /* DOM-IGNORE-END*/
13389  /* DMA address error. */
13390  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13391  = 1 << 1 /* DOM-IGNORE-END*/
13392  } SYS_DMA_ERROR ;
13393 // *****************************************************************************
13394 /* DMA Initialization data
13395  Summary:
13396  Defines the data required to initialize the DMA subsystem.
13397  Description:
13398  This data type defines the data required to initialize the DMA subsystem.
13399  Remarks:
13400  This feature may not be available on all devices. Refer to the specific device
13401  data sheet to determine availability.
13402 */
13403 
13404 typedef
13405  struct
13406  {
13407  /* Enable/Disable stop in idle mode feature */
13408  SYS_DMA_SIDL sidl ;
13409  } SYS_DMA_INIT ;
13410 // *****************************************************************************
13411 /* Data width options */
13412 
13413 typedef
13414  enum
13415  {
13416  /* Data width configuration feature is not available */
13418  } SYS_DMA_DATA_WIDTH ;
13419 // *****************************************************************************
13420 /* DMA descriptor control
13421  Summary:
13422  Defines the descriptor control for linked list operation.
13423  Description:
13424  This data type defines the descriptor control for linked list operation.
13425  Remarks:
13426  This feature may not be available on all devices. Refer to the specific device
13427  data sheet to determine availability.
13428 */
13429 
13430 typedef
13431  union
13432  {
13433  /* Feature is not supported */
13434  ;
13436 // *****************************************************************************
13437 // *****************************************************************************
13438 // Section: Initialization and Task Functions
13439 // *****************************************************************************
13440 // *****************************************************************************
13441 //******************************************************************************
13442 /* Function:
13443  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13444  Summary:
13445  Maintains the system service's state machine.
13446 
13447  Description:
13448  This function is used to maintain the DMA system service's internal state
13449  machine. This function services events on a specific DMA channel.
13450  Precondition:
13451  DMA should have been initialized by calling SYS_DMA_Initialize.
13452  Parameters:
13453  object - Object handle for the DMA module (returned from
13454  SYS_DMA_Initialize)
13455  activeChannel - DMA channel number to be serviced.
13456  Returns:
13457  None.
13458  Example:
13459  <code>
13460  // 'object' Returned from SYS_DMA_Initialize
13461  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13462  {
13463  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13464  }
13465  </code>
13466  Remarks:
13467  This function is normally not called directly by an application. It is
13468  called by the system's task/interrupt routines.
13469  */
13470 
13471 void
13472  SYS_DMA_Tasks (
13473  SYS_MODULE_OBJ object ,
13474  DMA_CHANNEL activeChannel ) ;
13475 //******************************************************************************
13476 /* For backward compatibility */
13477 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13478  // #ifndef _SYS_DMA_DEFINITIONS_H
13479 /*******************************************************************************
13480  End of File
13481 */
13482 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13483 /* CLOSE_FILE Include File */
13484 
13485 // DOM-IGNORE-BEGIN
13486 // DOM-IGNORE-END
13487 // *****************************************************************************
13488 // *****************************************************************************
13489 // Section: DMA System Service Interface Routines
13490 // *****************************************************************************
13491 // *****************************************************************************
13492 // *****************************************************************************
13493 /* DMA System service Transfer Event Handler Function
13494  Summary:
13495  Pointer to a DMA System service Transfer Event handler function.
13496  Description:
13497  This data type defines a DMA System service Transfer Event Handler Function.
13498  A DMA system service client must register an transfer event handler function of
13499  this type to receive transfer related events from the system service.
13500  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13501  was transferred successfully. The channelHandle parameter contains the channel
13502  handle of the channel on which the transfer was processed.
13503  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13504  not transferred successfully. TThe channelHandle parameter contains the channel
13505  handle of the channel on which the transfer had failed.
13506  The contextHandle parameter contains the context handle that was provided by
13507  the client at the time of registering the event handler. This context handle
13508  can be anything that the client consider helpful or necessary to identify
13509  the client context object associated with the channel of the system
13510  service that generated the event.
13511  The event handler function executes in an interrupt context when DMA is setup
13512  to start operation by an interrupt trigger source. It is recommended of the
13513  application to not perform process intensive operations with in this
13514  function.
13515  Remarks:
13516  None.
13517 */
13518 
13519 typedef
13521 SYS_DMA_CHANNEL_HANDLE handle ,
13522 uintptr_t contextHandle ) ;
13523 // *****************************************************************************
13524 // *****************************************************************************
13525 // Section: Initialization and Task Functions
13526 // *****************************************************************************
13527 // *****************************************************************************
13528 //******************************************************************************
13529 /* Function:
13530  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
13531  Summary:
13532  Initializes and Enables the DMA Controller.
13533  Description:
13534  This function Enables the DMA module. Enable/Disable stop in idle mode
13535  feature based on the passed parameter value.
13536  This function initializes the DMA module making it ready for clients to
13537  open and use it. The initialization data is specified by the init parameter.
13538  Precondition:
13539  None.
13540  Parameters:
13541  init - Pointer to the data structure containing any data
13542  necessary to initialize the hardware. This pointer may
13543  be null if no data is required and default
13544  initialization is to be used.
13545  Returns:
13546  If successful, returns a valid handle to the DMA module object.
13547  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
13548  Example:
13549  <code>
13550  SYS_MODULE_OBJ objectHandle;
13551  SYS_DMA_INIT initParam;
13552  initParam.sidl = SYS_DMA_SIDL_ENABLE;
13553  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
13554  (SYS_MODULE_INIT*)initParam);
13555  if (SYS_MODULE_OBJ_INVALID == objectHandle)
13556  {
13557  // Handle error
13558  }
13559  </code>
13560  Remarks:
13561  This function must be called before any other DMA systems service routines
13562  are called.
13563  Not all features are available on all micro-controllers.
13564 */
13565 
13566 SYS_MODULE_OBJ
13568  const SYS_MODULE_INIT * const init ) ;
13569 // *****************************************************************************
13570 // *****************************************************************************
13571 // Section: Channel Setup and management functions
13572 // *****************************************************************************
13573 // *****************************************************************************
13574 //******************************************************************************
13575 /* Function:
13576  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
13577  Summary:
13578  Allocates the specified DMA channel and returns a handle to it.
13579  Description:
13580  This function opens the specified DMA channel and provides a
13581  handle that must be provided to all other client-level operations to
13582  identify the caller and the DMA channel.
13583  Precondition:
13584  Function SYS_DMA_Initialize must have been called before calling this
13585  function.
13586  Parameters:
13587  channel - Channel number requested for allocation.
13588  When channel number specified is DMA_CHANNEL_ANY
13589  a random channel is allocated for DMA transfers.
13590  Returns:
13591  The channel handle for the requested channel number.
13592  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
13593  Error can occur.
13594  - if the requested channel number is invalid.
13595  - if the requested channel number is not free.
13596  Example:
13597  <code>
13598  DMA_CHANNEL channel;
13599  SYS_DMA_CHANNEL_HANDLE handle
13600  channel = DMA_CHANNEL_2;
13601  handle = SYS_DMA_ChannelAllocate(channel);
13602  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
13603  {
13604  // Failed to allocate the channel
13605  }
13606  else
13607  {
13608  // Proceed with setting up the channel and adding the transfer
13609  }
13610  </code>
13611  Remarks:
13612  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
13613  This function must be called before any other DMA channel Setup and management
13614  routines are called
13615 */
13616 
13619  DMA_CHANNEL channel ) ;
13620 //******************************************************************************
13621 /* Function:
13622  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
13623  Summary:
13624  Deallocates and frees the channel specified by the handle.
13625  Description:
13626  This function deallocates an allocated-channel of the DMA module,
13627  invalidating the handle.
13628  Precondition:
13629  DMA should have been initialized by calling SYS_DMA_Initialize.
13630  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
13631  Parameters:
13632  handle - A valid allocated-channel handle, returned from the service's
13633  Allocate routine
13634  Returns:
13635  None.
13636  Example:
13637  <code>
13638  DMA_CHANNEL channel;
13639  SYS_DMA_CHANNEL_HANDLE handle;
13640  channel = DMA_CHANNEL_2;
13641  handle = SYS_DMA_ChannelAllocate(channel);
13642  SYS_DMA_ChannelRelease(handle);
13643  </code>
13644  Remarks:
13645  After calling this routine, the handle passed in "handle" must not be used
13646  with any of the remaining service's routines. A new handle must be obtained by
13647  calling SYS_DMA_ChannelAllocate before the caller may use the service again
13648 */
13649 
13650 void
13652  SYS_DMA_CHANNEL_HANDLE handle ) ;
13653 //******************************************************************************
13654 /* Function:
13655  void SYS_DMA_ChannelSetup
13656  (
13657  SYS_DMA_CHANNEL_HANDLE handle,
13658  SYS_DMA_CHANNEL_OP_MODE modeEnable
13659  DMA_TRIGGER_SOURCE eventSrc
13660  )
13661  Summary:
13662  Setup the DMA channel parameters.
13663  Description:
13664  This function sets up the DMA channel parameters.
13665  It sets the channel priority and enables the mode of operations for the
13666  current system design.
13667  Precondition:
13668  DMA should have been initialized by calling SYS_DMA_Initialize.
13669  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13670  Parameters:
13671  handle - Handle of the DMA channel as returned by the
13672  SYS_DMA_ChannelAllocate function.
13673  priority - The priority to be associated to the channel.
13674  modeEnable - The supported operating modes to be enabled.
13675  This parameter can be logically ORed to specify
13676  multiple options.
13677  eventSrc - The event causing the cell transfer start.
13678  Returns:
13679  None.
13680  Example:
13681  <code>
13682  // 'handle' is a valid handle returned
13683  // by the SYS_DMA_ChannelAllocate function.
13684  SYS_DMA_CHANNEL_OP_MODE modeEnable;
13685  DMA_TRIGGER_SOURCE eventSrc;
13686  channel = DMA_CHANNEL_2;
13687  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
13688  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
13689  // Setup channel number, and enables basic and CRC mode
13690  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
13691  </code>
13692  Remarks:
13693  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
13694  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
13695  mode setup API's needs to be called to set the related parameters.
13696  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
13697  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
13698  Not all features are available on all microcontrollers.
13699  */
13700 
13701 void
13703  SYS_DMA_CHANNEL_HANDLE handle ,
13704  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
13705  DMA_TRIGGER_SOURCE eventSrc ) ;
13706 //******************************************************************************
13707 /* Function:
13708  void SYS_DMA_ChannelSetupMatchAbortMode
13709  (
13710  SYS_DMA_CHANNEL_HANDLE handle,
13711  uint16_t pattern,
13712  DMA_PATTERN_LENGTH length,
13713  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
13714  uint8_t ignorePattern
13715  )
13716  Summary:
13717  Setup the pattern match abort mode.
13718  Description:
13719  This function sets up the termination of DMA operation when the specified
13720  pattern is matched. Additionally on supported parts the function also
13721  sets up the ignoring of part of a pattern(8-bit) from match abort
13722  pattern(16-bit).
13723  Precondition:
13724  DMA should have been initialized by calling SYS_DMA_Initialize.
13725  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13726  The function SYS_DMA_ChannelSetup must be called to enable
13727  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
13728  match mode features.
13729  Parameters:
13730  handle - Handle of the DMA channel as returned by the
13731  SYS_DMA_ChannelAllocate function.
13732  pattern - The pattern that needs to be matched to abort a DMA transfer.
13733  length - Match pattern length can be 1-byte or 2-byte.
13734  ignore - Enable/Disable a byte between a 2-byte pattern match.
13735  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
13736  from the match abort pattern(16-bit)
13737  Returns:
13738  None.
13739  Example:
13740  <code>
13741  // Example 1
13742  // The following code is for a device with an 8-bit pattern value and no
13743  // support for pattern match ignore feature
13744  // 'handle' is a valid handle returned
13745  // by the SYS_DMA_ChannelAllocate function.
13746  uint16_t pattern;
13747  DMA_PATTERN_LENGTH length;
13748  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13749  uint8_t ignorePattern;
13750  pattern = 0x00; //Stop transfer on detection of a NULL character
13751  length = DMA_PATTERN_LENGTH_NONE;
13752  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
13753  ignorePattern = 0;
13754  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13755  ignoreEnable, ignorePattern);
13756  // Example 2
13757  // The following code is for a device with a 16-bit pattern value and
13758  // support for pattern match ignore feature
13759  // 'handle' is a valid handle returned
13760  // by the SYS_DMA_ChannelAllocate function.
13761  uint16_t pattern;
13762  DMA_PATTERN_LENGTH length;
13763  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13764  uint8_t ignorePattern;
13765  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
13766  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
13767  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
13768  ignorePattern = 0x00; \\ Any null character between the termination pattern
13769  \\ '\r' and '\n' is ignored.
13770  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13771  ignore, ignorePattern);
13772  </code>
13773  Remarks:
13774  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
13775  Not all features are available on all devices.
13776  Refer to the specific device data sheet for details.
13777 */
13778 
13779 void
13781  SYS_DMA_CHANNEL_HANDLE handle ,
13782  uint16_t pattern ,
13783  DMA_PATTERN_LENGTH length ,
13785  uint8_t ignorePattern ) ;
13786 //******************************************************************************
13787 /* Function:
13788  void SYS_DMA_ChannelCRCSet
13789  (
13790  SYS_DMA_CHANNEL_HANDLE handle,
13791  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
13792  )
13793  Summary:
13794  Sets up the CRC operation mode.
13795  Description:
13796  This function sets up the CRC computation features.
13797  Precondition:
13798  DMA should have been initialized by calling SYS_DMA_Initialize.
13799  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13800  The function SYS_DMA_ChannelSetup must be called to enable
13801  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13802  Parameters:
13803  handle - Handle of the DMA channel as returned by the
13804  SYS_DMA_ChannelAllocate function.
13805  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
13806  crc.mode - Compute the CRC in Background/Append mode.
13807  crc.polyLength - Denotes the length of the polynomial.
13808  crc.bitOrder - CRC is calculated LSb/MSb first.
13809  crc.byteOrder - Byte selection order input pre-CRC Generator
13810  crc.writeOrder - Write byte order selection post-CRC computation
13811  crc.data - Computed/Seed CRC
13812  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
13813  when mode is LFSR
13814  Returns:
13815  None.
13816  Example:
13817  <code>
13818  //Example 1
13819  // DMA calculation using the CRC background mode
13820  // 'handle' is a valid handle returned
13821  // by the SYS_DMA_ChannelAllocate function.
13822  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
13823  crc.type = DMA_CRC_LFSR;
13824  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
13825  crc.polyLength = 16;
13826  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
13827  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
13828  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
13829  crc.data = 0xFFFF;
13830  crc.xorBitMask = 0x1021;
13831  SYS_DMA_ChannelCRCSet(handle, crc);
13832  </code>
13833  Remarks:
13834  This feature may not be available on all devices. Refer to the specific device
13835  data sheet to determine availability.
13836 */
13837 
13838 void
13840  SYS_DMA_CHANNEL_HANDLE handle ,
13842 //******************************************************************************
13843 /* Function:
13844  uint32_t SYS_DMA_ChannelCRCGet(void)
13845  Summary:
13846  Returns the computed CRC.
13847  Description:
13848  This function returns the computed CRC
13849  Precondition:
13850  DMA should have been initialized by calling SYS_DMA_Initialize.
13851  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13852  The function SYS_DMA_ChannelSetup must be called to enable
13853  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13854  The CRC generator must have been previously setup using
13855  SYS_DMA_ChannelCRCSet.
13856  Parameters:
13857  None
13858  Returns:
13859  uint32_t - The Computed CRC.
13860  Example:
13861  <code>
13862  uint32_t computedCRC;
13863  computedCRC = SYS_DMA_ChannelCRCGet();
13864  </code>
13865  Remarks:
13866  To get the computed CRC value this function must be called after the block
13867  transfer completion event (i.e., after getting and processing the callback
13868  registered with SYS_DMA_ChannelTransferEventHandlerSet).
13869  This feature may not be available on all devices. Refer to the specific device
13870  data sheet to determine availability.
13871 */
13872 
13873 uint32_t
13874  SYS_DMA_ChannelCRCGet ( void ) ;
13875 //******************************************************************************
13876 /* Function:
13877  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
13878  Summary:
13879  Enables a channel.
13880  Description:
13881  This function enables a channel.
13882  Precondition:
13883  DMA should have been initialized by calling SYS_DMA_Initialize.
13884  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13885  The function SYS_DMA_ChannelSetup must have been called to setup and
13886  enable the required features.
13887  Parameters:
13888  handle - Handle of the DMA channel as returned by the
13889  SYS_DMA_ChannelAllocate function.
13890  Returns:
13891  None.
13892  Example:
13893  <code>
13894  // 'handle' is a valid handle returned
13895  // by the SYS_DMA_ChannelAllocate function.
13896  SYS_DMA_ChannelEnable(handle);
13897  </code>
13898  Remarks:
13899  This function may not required to be called when starting DMA setup
13900  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
13901  But may be needed to be called in the registered callback to enable the
13902  channel and continue the data transfer with the existing transfer parameters
13903  previously set with 'SYS_DMA_ChannelTransferAdd'.
13904  The DMA channel is by default disabled on the completion of block
13905  transfer(callback generated)
13906 */
13907 
13908 void
13910  SYS_DMA_CHANNEL_HANDLE handle ) ;
13911 //******************************************************************************
13912 /* Function:
13913  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
13914  Summary:
13915  Disables a channel.
13916  Description:
13917  This function disables a channel.
13918  Precondition:
13919  DMA should have been initialized by calling SYS_DMA_Initialize.
13920  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13921  The function SYS_DMA_ChannelSetup must have been called to setup and
13922  enable the required features.
13923  A DMA channel should have been enabled either by calling
13924  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
13925  Parameters:
13926  handle - Handle of the DMA channel as returned by the
13927  SYS_DMA_ChannelAllocate function.
13928  Returns:
13929  None.
13930  Example:
13931  <code>
13932  // 'handle' is a valid handle returned
13933  // by the SYS_DMA_ChannelAllocate function.
13934  SYS_DMA_ChannelDisable(handle);
13935  </code>
13936  Remarks:
13937  None.
13938 */
13939 
13940 void
13942  SYS_DMA_CHANNEL_HANDLE handle ) ;
13943 //******************************************************************************
13944 /* Function:
13945  void SYS_DMA_ChannelTransferAdd
13946  (
13947  SYS_DMA_CHANNEL_HANDLE handle,
13948  const void *srcAddr, size_t srcSize
13949  const void *destAddr, size_t destSize,
13950  size_t cellSize
13951  )
13952  Summary:
13953  Adds a data transfer to a DMA channel and Enables the channel to start
13954  data transfer.
13955  Description:
13956  This function adds a data transfer characteristics for a DMA channel. The
13957  The source and the destination addresses, source and destination lengths,
13958  The number of bytes transferred per cell event are set. It also enables
13959  the channel to start data transfer.
13960  If the requesting client registered an event callback with the service,
13961  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
13962  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
13963  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
13964  processed successfully.
13965  Precondition:
13966  DMA should have been initialized by calling SYS_DMA_Initialize.
13967  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13968  The function SYS_DMA_ChannelSetup must have been called to setup and
13969  enable the required features.
13970  Parameters:
13971  handle - Handle of the DMA channel as returned by the
13972  SYS_DMA_ChannelAllocate function.
13973  srcAddr - Source of the DMA transfer
13974  srcSize - Size of the source
13975  destAddr - Destination of the DMA transfer
13976  destSize - Size of the destination
13977  cellSize - Size of the cell
13978  Returns:
13979  None.
13980  Example:
13981  <code>
13982  // Add 10 bytes of data transfer to UART TX
13983  // 'handle' is a valid handle returned
13984  // by the SYS_DMA_ChannelAllocate function.
13985  MY_APP_OBJ myAppObj;
13986  uint8_t buf[10];
13987  void *srcAddr;
13988  void *destAddr;
13989  size_t srcSize;
13990  size_t destSize;
13991  size_t cellSize;
13992  srcAddr = (uint8_t *) buf;
13993  srcSize = 10;
13994  destAddr = (uin8_t*) &U2TXREG;
13995  destSize = 1;
13996  cellSize = 1;
13997  // User registers an event handler with system service. This is done once
13998  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
13999  (uintptr_t)&myAppObj);
14000  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14001  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14002  {
14003  // Error handling here
14004  }
14005  // Event Processing Technique. Event is received when
14006  // the transfer is processed.
14007  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14008  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14009  {
14010  switch(event)
14011  {
14012  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14013  // This means the data was transferred.
14014  break;
14015  case SYS_DMA_TRANSFER_EVENT_ERROR:
14016  // Error handling here.
14017  break;
14018  default:
14019  break;
14020  }
14021  }
14022  </code>
14023  Remarks:
14024  For PIC32MZ series of devices, if the source/destination addresses are
14025  RAM memory addresses, the the source/destination buffers
14026  should be made coherent to avoid the cache coherency issues.
14027  For example:
14028  <code>
14029  uint8_t buffer[1024];
14030  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14031  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14032  </code>
14033 */
14034 
14035 void
14037  SYS_DMA_CHANNEL_HANDLE handle ,
14038  const void * srcAddr ,
14039  size_t srcSize ,
14040  const void * destAddr ,
14041  size_t destSize ,
14042  size_t cellSize ) ;
14043 //******************************************************************************
14044 /* Function:
14045  void SYS_DMA_ChannelTransferSet
14046  (
14047  SYS_DMA_CHANNEL_HANDLE handle,
14048  const void *srcAddr, size_t srcSize
14049  const void *destAddr, size_t destSize,
14050  size_t cellSize
14051  )
14052  Summary:
14053  Sets up a data transfer to a DMA channel.
14054  Description:
14055  This function sets up data transfer characteristics for a DMA channel. The
14056  The source and the destination addresses, source and destination lengths,
14057  The number of bytes transferred per cell event are set.
14058  This function does not enables the DMA channel. The channel has to be explicitly
14059  enabled to start the data transfer.
14060  The above functions could be used in situations where in the user intends to
14061  setup transfer parameters but do not intend to enable the channel immediately.
14062  For example to chain to DMA channels in a cyclic order where the channels remains
14063  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14064  condition occurs.
14065  Precondition:
14066  DMA should have been initialized by calling SYS_DMA_Initialize.
14067  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14068  The function SYS_DMA_ChannelSetup must have been called to setup and
14069  enable the required features.
14070  Parameters:
14071  handle - Handle of the DMA channel as returned by the
14072  SYS_DMA_ChannelAllocate function.
14073  srcAddr - Source of the DMA transfer
14074  srcSize - Size of the source
14075  destAddr - Destination of the DMA transfer
14076  destSize - Size of the destination
14077  cellSize - Size of the cell
14078  Returns:
14079  None.
14080  Example:
14081  <code>
14082  // Set up 10 bytes of data transfer to UART TX
14083  // 'handle' is a valid handle returned
14084  // by the SYS_DMA_ChannelAllocate function.
14085  MY_APP_OBJ myAppObj;
14086  uint8_t buf[10];
14087  void *srcAddr;
14088  void *destAddr;
14089  size_t srcSize;
14090  size_t destSize;
14091  size_t cellSize;
14092  srcAddr = (uint8_t *) buf;
14093  srcSize = 10;
14094  destAddr = (uin8_t*) &U2TXREG;
14095  destSize = 1;
14096  cellSize = 1;
14097  // User registers an event handler with system service. This is done once
14098  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14099  (uintptr_t)&myAppObj);
14100  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14101  SYS_DMA_ChannelEnable(handle);
14102  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14103  {
14104  // Error handling here
14105  }
14106  // Event Processing Technique. Event is received when
14107  // the transfer is processed.
14108  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14109  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14110  {
14111  switch(event)
14112  {
14113  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14114  // This means the data was transferred.
14115  break;
14116  case SYS_DMA_TRANSFER_EVENT_ERROR:
14117  // Error handling here.
14118  break;
14119  default:
14120  break;
14121  }
14122  }
14123  </code>
14124  Remarks:
14125  For PIC32MZ series of devices, if the source/destination addresses are
14126  RAM memory addresses, the the source/destination buffers
14127  should be made coherent to avoid the cache coherency issues.
14128  For example:
14129  <code>
14130  uint8_t buffer[1024];
14131  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14132  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14133  </code>
14134 */
14135 
14136 void
14138  SYS_DMA_CHANNEL_HANDLE handle ,
14139  const void * srcAddr ,
14140  size_t srcSize ,
14141  const void * destAddr ,
14142  size_t destSize ,
14143  size_t cellSize ) ;
14144 //******************************************************************************
14145 /* Function:
14146  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14147  Summary:
14148  Returns the number of bytes transferred from source.
14149  Description:
14150  When a data transfer request is submitted. At any time while the transmission
14151  is in progress the size of the amount of data transferred from source
14152  can be known by calling this function.
14153  Precondition:
14154  DMA should have been initialized by calling SYS_DMA_Initialize.
14155  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14156  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14157  SYS_DMA_ChannelTransferSet.
14158  Parameters:
14159  handle - A valid channel handle, returned from the system service's
14160  Allocate routine
14161  Returns:
14162  size_t - Returns the number of bytes transferred from the submitted size.
14163  Example:
14164  <code>
14165  // 'handle' is a valid handle returned
14166  // by the SYS_DMA_ChannelAllocate function.
14167  MY_APP_OBJ myAppObj;
14168  uint8_t buf[10];
14169  void *srcAddr;
14170  void *destAddr;
14171  size_t srcSize;
14172  size_t destSize;
14173  size_t cellSize;
14174  size_t transferredSize;
14175  srcAddr = (uint8_t *) buf;
14176  srcSize = 10;
14177  destAddr = (uin8_t*) &U2TXREG;
14178  destSize = 1;
14179  cellSize = 1;
14180  channelHandle = SYS_DMA_ChannelAllocate(channel);
14181  // User registers an event handler with system service. This is done once
14182  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14183  (uintptr_t)&myAppObj);
14184  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14185  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14186  {
14187  // Error handling here
14188  }
14189  // The data is being transferred after adding the transfer to the DMA channel.
14190  // The user can get to know dynamically the amount of data
14191  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14192  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14193  </code>
14194  Remarks:
14195  None.
14196 */
14197 
14198 size_t
14200  SYS_DMA_CHANNEL_HANDLE handle ) ;
14201 //******************************************************************************
14202 /* Function:
14203  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14204  Summary:
14205  Returns the number of bytes transferred to destination.
14206  Description:
14207  When a data transfer request is submitted. At any time while the transmission
14208  is in progress the size of the amount of data transferred to destination
14209  can be known by calling this function.
14210  Precondition:
14211  DMA should have been initialized by calling SYS_DMA_Initialize.
14212  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14213  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14214  SYS_DMA_ChannelTransferSet.
14215  Parameters:
14216  handle - A valid channel handle, returned from the system service's
14217  Allocate routine
14218  Returns:
14219  size_t - Returns the number of bytes received from the submitted size.
14220  Example:
14221  <code>
14222  // 'handle' is a valid handle returned
14223  // by the SYS_DMA_ChannelAllocate function.
14224  MY_APP_OBJ myAppObj;
14225  uint8_t buf[10];
14226  void *srcAddr;
14227  void *destAddr;
14228  size_t srcSize;
14229  size_t destSize;
14230  size_t cellSize;
14231  size_t transferredSize;
14232  srcAddr = (uin8_t*) &U2RXREG;
14233  srcSize = 1;
14234  destAddr = (uint8_t *) buf ;
14235  destSize = 10;
14236  cellSize = 1;
14237  channelHandle = SYS_DMA_ChannelAllocate(channel);
14238  // User registers an event handler with system service. This is done once
14239  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14240  (uintptr_t)&myAppObj);
14241  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14242  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14243  {
14244  // Error handling here
14245  }
14246  // The data is being transferred after adding the transfer to the DMA channel.
14247  // The user can get to know dynamically the amount of data
14248  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14249  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14250  </code>
14251  Remarks:
14252  None.
14253 */
14254 
14255 size_t
14257  SYS_DMA_CHANNEL_HANDLE handle ) ;
14258 //******************************************************************************
14259 /*
14260  Function:
14261  void SYS_DMA_ChannelTransferEventHandlerSet
14262  (
14263  SYS_DMA_CHANNEL_HANDLE handle,
14264  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14265  const uintptr_t contextHandle
14266  )
14267  Summary:
14268  This function allows a DMA system service client to set an event handler.
14269  Description:
14270  This function allows a client to set an event handler. The client may want
14271  to receive transfer related events in cases when it uses non-blocking read and
14272  write functions. The event handler should be set before the client
14273  intends to perform operations that could generate events.
14274  This function accepts a contextHandle parameter. This parameter could be
14275  set by the client to contain (or point to) any client specific data object
14276  that should be associated with this DMA channel.
14277  Precondition:
14278  DMA should have been initialized by calling SYS_DMA_Initialize.
14279  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14280  Parameters:
14281  handle - A valid channel handle, returned from the system service's
14282  Allocate routine
14283  eventHandler - Pointer to the event handler function.
14284  contextHandle - Value identifying the context of the application/driver/middleware
14285  that registered the event handling function.
14286  Returns:
14287  None.
14288  Example:
14289  <code>
14290  // 'handle' is a valid handle returned
14291  // by the SYS_DMA_ChannelAllocate function.
14292  MY_APP_OBJ myAppObj;
14293  uint8_t buf[10];
14294  void *srcAddr;
14295  void *destAddr;
14296  size_t srcSize;
14297  size_t destSize;
14298  size_t cellSize;
14299  srcAddr = (uint8_t *) buf;
14300  srcSize = 10;
14301  destAddr = (uin8_t*) &U2TXREG;
14302  destSize = 1;
14303  cellSize = 1;
14304  channelHandle = SYS_DMA_ChannelAllocate(channel);
14305  // User registers an event handler with system service. This is done once
14306  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14307  (uintptr_t)&myAppObj);
14308  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14309  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14310  {
14311  // Error handling here
14312  }
14313  // Event Processing Technique. Event is received when
14314  // the transfer is processed.
14315  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14316  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14317  {
14318  switch(event)
14319  {
14320  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14321  // This means the data was transferred.
14322  break;
14323  case SYS_DMA_TRANSFER_EVENT_ERROR:
14324  // Error handling here.
14325  break;
14326  default:
14327  break;
14328  }
14329  }
14330  </code>
14331  Remarks:
14332  None.
14333  */
14334 
14335 void
14337  SYS_DMA_CHANNEL_HANDLE handle ,
14338  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14339  const uintptr_t contextHandle ) ;
14340 // *****************************************************************************
14341 /* Function:
14342  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14343  Summary:
14344  This function returns the error(if any) associated with the last client
14345  request.
14346  Description:
14347  This function returns the error(if any) associated with the last client
14348  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14349  the client can call this function to know the error cause.
14350  The error status will be updated on every operation and should be read
14351  frequently (ideally immediately after the service operation has completed)
14352  to know the relevant error status.
14353  Precondition:
14354  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14355  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14356  handle.
14357  Parameters:
14358  handle - Handle of the DMA channel as returned by the
14359  SYS_DMA_ChannelAllocate function.
14360  Returns:
14361  A SYS_DMA_ERROR type indicating last known error status.
14362  Example:
14363  <code>
14364  // 'handle' is a valid handle returned
14365  // by the SYS_DMA_ChannelAllocate function.
14366  // pDmaSrc, pDmaDst is the source,destination address
14367  // txferSrcSize, txferDesSize is the source,destination transfer size
14368  // cellSize is the cell size
14369  MY_APP_OBJ myAppObj;
14370  // Client registers an event handler with service. This is done once
14371  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14372  (uintptr_t)&myAppObj );
14373  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14374  DMA_TRIGGER_SOURCE_NONE);
14375  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14376  pDmaDst,txferDesSize,cellSize);
14377  SYS_DMA_ChannelForceStart(handle);
14378  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14379  {
14380  // Error handling here
14381  }
14382  // Event Processing Technique. Event is received when
14383  // the transfer is processed.
14384  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14385  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14386  {
14387  switch(event)
14388  {
14389  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14390  // This means the data was transferred.
14391  break;
14392  case SYS_DMA_TRANSFER_EVENT_ERROR:
14393  // Error handling here.
14394  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14395  {
14396  // There was an address error.
14397  // Do error handling here.
14398  }
14399  break;
14400  default:
14401  break;
14402  }
14403  }
14404  </code>
14405  Remarks:
14406  It is the client's responsibility to make sure that the error status is
14407  obtained frequently. The service will update the error status
14408  regardless of whether this has been examined by the client.
14409 */
14410 
14413  SYS_DMA_CHANNEL_HANDLE handle ) ;
14414 //******************************************************************************
14415 /* Function:
14416  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14417  Summary:
14418  Force start of transfer on the selected channel.
14419  Description:
14420  The function force start a DMA transfer to occur for the selected channel.
14421  Precondition:
14422  DMA should have been initialized by calling SYS_DMA_Initialize.
14423  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14424  The function SYS_DMA_ChannelSetup must have been called to setup and
14425  enable the required features.
14426  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14427  Parameters:
14428  handle - Handle of the DMA channel as returned by the
14429  SYS_DMA_ChannelAllocate function.
14430  Returns:
14431  None.
14432  Example:
14433  <code>
14434  // 'handle' is a valid handle returned
14435  // by the SYS_DMA_ChannelAllocate function.
14436  // pDmaSrc, pDmaDst is the source,destination address
14437  // txferSrcSize, txferDesSize is the source,destination transfer size
14438  // cellSize is the cell size
14439  MY_APP_OBJ myAppObj;
14440  // Client registers an event handler with service. This is done once
14441  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14442  (uintptr_t)&myAppObj );
14443  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14444  DMA_TRIGGER_SOURCE_NONE);
14445  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14446  pDmaDst,txferDesSize,cellSize);
14447  SYS_DMA_ChannelForceStart(handle);
14448  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14449  {
14450  // Error handling here
14451  }
14452  // Event Processing Technique. Event is received when
14453  // the transfer is processed.
14454  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14455  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14456  {
14457  switch(event)
14458  {
14459  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14460  // This means the data was transferred.
14461  break;
14462  case SYS_DMA_TRANSFER_EVENT_ERROR:
14463  // Error handling here.
14464  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14465  {
14466  // There was an address error.
14467  // Do error handling here.
14468  }
14469  break;
14470  default:
14471  break;
14472  }
14473  }
14474  </code>
14475  Remarks:
14476  This function must be used to start the DMA transfer when the channel has been
14477  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14478 */
14479 
14480 void
14482  SYS_DMA_CHANNEL_HANDLE handle ) ;
14483 //******************************************************************************
14484 /* Function:
14485  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14486  Summary:
14487  Force abort of transfer on the selected channel.
14488  Description:
14489  The function aborts a DMA transfer to occur for the selected channel.
14490  Precondition:
14491  DMA should have been initialized by calling SYS_DMA_Initialize.
14492  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14493  The function SYS_DMA_ChannelSetup must have been called to setup and
14494  enable the required features.
14495  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14496  Parameters:
14497  handle - Handle of the DMA channel as returned by the
14498  SYS_DMA_ChannelAllocate function.
14499  Returns:
14500  None.
14501  Example:
14502  <code>
14503  // 'handle' is a valid handle returned
14504  // by the SYS_DMA_ChannelAllocate function.
14505  // pDmaSrc, pDmaDst is the source,destination address
14506  // txferSrcSize, txferDesSize is the source,destination transfer size
14507  // cellSize is the cell size
14508  MY_APP_OBJ myAppObj;
14509  // Client registers an event handler with service. This is done once
14510  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14511  (uintptr_t)&myAppObj );
14512  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14513  DMA_TRIGGER_SOURCE_NONE);
14514  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14515  pDmaDst,txferDesSize,cellSize);
14516  SYS_DMA_ChannelForceStart(handle);
14517  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14518  {
14519  // Error handling here
14520  }
14521  ....
14522  ....
14523  // Client may need to abort a transfer
14524  SYS_DMA_ChannelForceAbort(handle);
14525  // Event Processing Technique. Event is received when
14526  // the transfer is processed.
14527  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14528  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14529  {
14530  switch(event)
14531  {
14532  case SYS_DMA_TRANSFER_EVENT_ABORT:
14533  // This means the data was transferred.
14534  break;
14535  case SYS_DMA_TRANSFER_EVENT_ERROR:
14536  // Error handling here.
14537  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14538  {
14539  // There was an address error.
14540  // Do error handling here.
14541  }
14542  break;
14543  default:
14544  break;
14545  }
14546  }
14547  </code>
14548  Remarks:
14549  This function must be used to abort the DMA transfer when the channel has been
14550  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14551  and SYS_DMA_ChannelAbortEventSet has not been called.
14552 */
14553 
14554 void
14556  SYS_DMA_CHANNEL_HANDLE handle ) ;
14557 //******************************************************************************
14558 /* Function:
14559  void SYS_DMA_ChannelAbortEventSet
14560  (
14561  SYS_DMA_CHANNEL_HANDLE handle,
14562  DMA_TRIGGER_SOURCE eventSrc
14563  )
14564  Summary:
14565  Sets an event source and enables cell transfer abort event for the same
14566  for the selected channel.
14567  Description:
14568  This functions enables a cell transfer abort event for the selected source
14569  event.
14570  Precondition:
14571  DMA should have been initialized by calling SYS_DMA_Initialize.
14572  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14573  The function SYS_DMA_ChannelSetup must have been called to setup and
14574  enable the required features.
14575  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14576  Parameters:
14577  handle - Handle of the DMA channel as returned by the
14578  SYS_DMA_ChannelAllocate function.
14579  eventSrc - The event causing the cell transfer abort
14580  Returns:
14581  None.
14582  Example:
14583  <code>
14584  // 'handle' is a valid handle returned
14585  // by the SYS_DMA_ChannelAllocate function.
14586  // pDmaSrc, pDmaDst is the source,destination address
14587  // txferSrcSize, txferDesSize is the source,destination transfer size
14588  // cellSize is the cell size
14589  MY_APP_OBJ myAppObj;
14590  // Client registers an event handler with service. This is done once
14591  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14592  (uintptr_t)&myAppObj );
14593  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14594  DMA_TRIGGER_SOURCE_NONE);
14595  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14596  pDmaDst,txferDesSize,cellSize);
14597  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
14598  SYS_DMA_ChannelForceStart(handle);
14599  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14600  {
14601  // Error handling here
14602  }
14603  // Event Processing Technique. Event is received when
14604  // the transfer is processed.
14605  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14606  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14607  {
14608  switch(event)
14609  {
14610  case SYS_DMA_TRANSFER_EVENT_ABORT:
14611  // This means the data was transferred.
14612  break;
14613  case SYS_DMA_TRANSFER_EVENT_ERROR:
14614  // Error handling here.
14615  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14616  {
14617  // There was an address error.
14618  // Do error handling here.
14619  }
14620  break;
14621  default:
14622  break;
14623  }
14624  }
14625  </code>
14626  Remarks:
14627  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
14628  current DMA transfer will be aborted. The behavior is a same as calling
14629  SYS_DMA_ChannelForceAbort.
14630 */
14631 
14632 void
14634  SYS_DMA_CHANNEL_HANDLE handle ,
14635  DMA_TRIGGER_SOURCE eventSrc ) ;
14636 //******************************************************************************
14637 /* Function:
14638  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
14639  Summary:
14640  Returns the busy status of the specified DMA channel.
14641  Description:
14642  This function returns the busy status of the selected DMA channel
14643  Precondition:
14644  DMA should have been initialized by calling SYS_DMA_Initialize.
14645  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14646  Parameters:
14647  handle - Handle of the DMA channel as returned by the
14648  SYS_DMA_ChannelAllocate function.
14649  Returns:
14650  bool - true, if the selected DMA channel is active or enabled
14651  - false, if the selected DMA channel is inactive or disabled
14652  Example:
14653  <code>
14654  bool busyStat;
14655  busyStat = SYS_DMA_ChannelGetBusy(handle);
14656  </code>
14657  Remarks:
14658  This feature may not be available on all devices. Refer to the specific device
14659  data sheet to determine availability.
14660 */
14661 
14662 bool
14664  SYS_DMA_CHANNEL_HANDLE handle ) ;
14665 //******************************************************************************
14666 /* Function:
14667  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
14668  Summary:
14669  Suspend DMA operation on the specified DMA channel.
14670  Description:
14671  This function suspends the DMA operation on the DMA channel
14672  specified by the channel handle.
14673  Precondition:
14674  DMA should have been initialized by calling SYS_DMA_Initialize.
14675  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14676  Parameters:
14677  handle - Handle of the DMA channel as returned by the
14678  SYS_DMA_ChannelAllocate function.
14679  Returns:
14680  None.
14681  Example:
14682  <code>
14683  SYS_DMA_ChannelSuspend(handle);
14684  </code>
14685  Remarks:
14686  This feature may not be available on all devices. Refer to the specific device
14687  data sheet to determine availability.
14688 */
14689 
14690 void
14692  SYS_DMA_CHANNEL_HANDLE handle ) ;
14693 //******************************************************************************
14694 /* Function:
14695  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
14696  Summary:
14697  Resume DMA operation on the specified DMA channel.
14698  Description:
14699  This function resumes the DMA operation on the DMA channel
14700  specified by the channel handle.
14701  Precondition:
14702  DMA should have been initialized by calling SYS_DMA_Initialize.
14703  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14704  Parameters:
14705  handle - Handle of the DMA channel as returned by the
14706  SYS_DMA_ChannelAllocate function.
14707  Returns:
14708  None.
14709  Example:
14710  <code>
14711  SYS_DMA_ChannelResume(handle);
14712  </code>
14713  Remarks:
14714  This feature may not be available on all devices. Refer to the specific device
14715  data sheet to determine availability.
14716 */
14717 
14718 void
14720  SYS_DMA_CHANNEL_HANDLE handle ) ;
14721 // *****************************************************************************
14722 // *****************************************************************************
14723 // Section: Global DMA Management Functions
14724 // *****************************************************************************
14725 // *****************************************************************************
14726 //******************************************************************************
14727 /* Function:
14728  void SYS_DMA_Suspend(void)
14729  Summary:
14730  Suspend DMA transfers.
14731  Description:
14732  This function suspends DMA transfers to allow CPU uninterrupted access
14733  to data bus
14734  Precondition:
14735  DMA should have been initialized by calling SYS_DMA_Initialize.
14736  Parameters:
14737  None.
14738  Returns:
14739  None.
14740  Example:
14741  <code>
14742  SYS_DMA_Suspend();
14743  </code>
14744  Remarks:
14745  None
14746 */
14747 
14748 void
14749  SYS_DMA_Suspend ( void ) ;
14750 //******************************************************************************
14751 /* Function:
14752  void SYS_DMA_Resume(void)
14753  Summary:
14754  Resume DMA operations.
14755  Description:
14756  This function disables DMA suspend. It resumes the DMA operation suspended
14757  by calling SYS_DMA_Suspend. The DMA operates normally.
14758  Precondition:
14759  DMA should have been initialized by calling SYS_DMA_Initialize.
14760  Parameters:
14761  None.
14762  Returns:
14763  None.
14764  Example:
14765  <code>
14766  SYS_DMA_Resume();
14767  </code>
14768  Remarks:
14769  None
14770 */
14771 
14772 void
14773  SYS_DMA_Resume ( void ) ;
14774 //******************************************************************************
14775 /* Function:
14776  bool SYS_DMA_IsBusy(void)
14777  Summary:
14778  Returns the busy status of the DMA module.
14779  Description:
14780  This function returns the busy status of the DMA module
14781  Precondition:
14782  DMA should have been initialized by calling SYS_DMA_Initialize.
14783  Parameters:
14784  None.
14785  Returns:
14786  Boolean
14787  - true - The DMA module is active
14788  - false - The DMA module is inactive and disabled
14789  <code>
14790  bool busyStat;
14791  busyStat = SYS_DMA_IsBusy();
14792  </code>
14793  Remarks:
14794  This feature may not be available on all devices. Refer to the specific device
14795  data sheet to determine availability.
14796 */
14797 
14798 bool
14799  SYS_DMA_IsBusy ( void ) ;
14800 // *****************************************************************************
14801 // *****************************************************************************
14802 // Section: Deprecated functions
14803 // *****************************************************************************
14804 // *****************************************************************************
14805 //*******************************************************************************
14806 /* Function:
14807  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14808  Summary:
14809  This function is deprecated. Use SYS_DMA_Tasks function.
14810  */
14811 
14812 void
14813  SYS_DMA_Tasks (
14814  SYS_MODULE_OBJ object ,
14815  DMA_CHANNEL activeChannel ) ;
14816 //*****************************************************************************
14817 /* Function:
14818  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
14819  Summary:
14820  This function is deprecated. Use SYS_DMA_Tasks function.
14821  */
14822 
14823 void
14825  SYS_MODULE_OBJ object ) ;
14826 //*******************************************************************************
14827 /* Function:
14828  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14829  Summary:
14830  This function is deprecated. Use SYS_DMA_Tasks function.
14831  */
14832 
14833 void
14835  SYS_MODULE_OBJ object ,
14836  DMA_CHANNEL activeChannel ) ;
14837  // #ifndef _SYS_DMA_H
14838 /*******************************************************************************
14839  End of File
14840 */
14841 
14842 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
14843 /* CLOSE_FILE Include File */
14844 
14845 // DOM-IGNORE-BEGIN
14846 // DOM-IGNORE-END
14847 // *****************************************************************************
14848 // *****************************************************************************
14849 // Section: Data Types
14850 // *****************************************************************************
14851 // *****************************************************************************
14852 // *****************************************************************************
14853 /* Driver USART Module Index
14854  Summary:
14855  USART driver index definitions
14856  Description:
14857  These constants provide USART driver index definitions.
14858  Remarks:
14859  These constants should be used in place of hard-coded numeric literals.
14860  These values should be passed into the DRV_USART_Initialize and
14861  DRV_USART_Open routines to identify the driver instance in use.
14862 */
14863 #define DRV_USART_INDEX_0 0
14864 #define DRV_USART_INDEX_1 1
14865 #define DRV_USART_INDEX_2 2
14866 #define DRV_USART_INDEX_3 3
14867 #define DRV_USART_INDEX_4 4
14868 #define DRV_USART_INDEX_5 5
14869 // *****************************************************************************
14870 /* USART Driver Module Count
14871  Summary:
14872  Number of valid USART drivers
14873  Description:
14874  This constant identifies the maximum number of USART Driver instances that
14875  should be defined in the system. Defining more instances than this
14876  constant will waste RAM memory space.
14877  This constant can also be used by the system and application to identify the
14878  number of USART instances on this microcontroller.
14879  Remarks:
14880  This value is part-specific.
14881 */
14882 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
14883 // *****************************************************************************
14884 /* USART Driver Write Error
14885  Summary:
14886  USART Driver Write Error.
14887  Description:
14888  This constant is returned by DRV_USART_Write() function when an error
14889  occurs.
14890  Remarks:
14891  None.
14892 */
14893 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
14894 // *****************************************************************************
14895 /* USART Driver Read Error
14896  Summary:
14897  USART Driver Read Error.
14898  Description:
14899  This constant is returned by DRV_USART_Read() function when an error
14900  occurs.
14901  Remarks:
14902  None.
14903 */
14904 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
14905 // *****************************************************************************
14906 /* USART Driver Buffer Handle
14907  Summary:
14908  Handle identifying a read or write buffer passed to the driver.
14909  Description:
14910  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
14911  or DRV_USART_BufferAddWrite functions. This handle is associated with the
14912  buffer passed into the function and it allows the application to track the
14913  completion of the data from (or into) that buffer. The buffer handle value
14914  returned from the "buffer add" function is returned back to the client
14915  by the "event handler callback" function registered with the driver.
14916  The buffer handle assigned to a client request expires when the client has
14917  been notified of the completion of the buffer transfer (after event handler
14918  function that notifies the client returns) or after the buffer has been
14919  retired by the driver if no event handler callback was set.
14920  Remarks:
14921  None
14922 */
14923 
14924 typedef
14925 uintptr_t
14927 // *****************************************************************************
14928 /* USART Driver Invalid Buffer Handle
14929  Summary:
14930  Definition of an invalid buffer handle.
14931  Description:
14932  This is the definition of an invalid buffer handle. An invalid buffer handle
14933  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
14934  functions if the buffer add request was not successful.
14935  Remarks:
14936  None
14937 */
14938 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
14939 // *****************************************************************************
14940 /* USART Modes of Operation
14941  Summary:
14942  Identifies the modes of the operation of the USART module
14943  Description:
14944  This data type identifies the modes of the operation of the USART module.
14945  Remarks:
14946  Not all modes are available on all devices. Refer to the specific device data
14947  sheet to determine availability.
14948 */
14949 
14950 typedef
14951  enum
14952  {
14953  /* USART works in IRDA mode */
14955  /* This is the normal point to point communication mode where the USART
14956  communicates directly with another USART by connecting it's Transmit signal
14957  to the external USART's Receiver signal and vice versa. An external
14958  transceiver may be connected to obtain RS-232 signal levels. This type of
14959  connection is typically full duplex. */
14961  /* This is a multi-point bus mode where the USART can communicate with
14962  many other USARTS on a bus using an address-based protocol such as RS-485.
14963  This mode is typically half duplex and the physical layer may require a
14964  transceiver. In this mode every USART on the bus is assigned an address and
14965  the number of data bits is 9 bits */
14967  /* Loopback mode internally connects the Transmit signal to the Receiver
14968  signal, looping data transmission back into this USART's own input. It is
14969  useful primarily as a test mode. */
14972 // *****************************************************************************
14973 /* USART Driver Buffer Events
14974  Summary
14975  Identifies the possible events that can result from a buffer add request.
14976  Description
14977  This enumeration identifies the possible events that can result from a
14978  buffer add request caused by the client calling either the
14979  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
14980  Remarks:
14981  One of these values is passed in the "event" parameter of the event
14982  handling callback function that the client registered with the driver by
14983  calling the DRV_USART_BufferEventHandlerSet function when a buffer
14984  transfer request is completed.
14985 */
14986 
14987 typedef
14988  enum
14989  {
14990  /* All data from or to the buffer was transferred successfully. */
14992  /* There was an error while processing the buffer transfer request. */
14994  /* Data transfer aborted (Applicable in DMA mode) */
14997 // *****************************************************************************
14998 /* USART Driver Buffer Result
14999  Summary
15000  Identifies the possible result of the buffer processing.
15001  Description
15002  This enumeration identifies the possible result of the buffer processing.
15003 
15004  Remarks:
15005  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15006  is in the free buffer pool.
15007 */
15008 
15009 typedef
15010  enum
15011  {
15012  /* Buffer handle is not valid*/
15014  /* Buffer handle has expired. */
15016  /* Buffer is removed from the queue succesfully*/
15018  /* Buffer removal failed because of unable to acquire the mutex
15019  * This is applicable in RTOS mode only */
15022 // *****************************************************************************
15023 /* USART Driver Buffer Event Handler Function Pointer
15024  Summary
15025  Pointer to a USART Driver Buffer Event handler function
15026  Description
15027  This data type defines the required function signature for the USART driver
15028  buffer event handling callback function. A client must register a pointer
15029  to a buffer event handling function whose function signature (parameter
15030  and return value types) match the types specified by this function pointer
15031  in order to receive buffer related event calls back from the driver.
15032  The parameters and return values and are described here and
15033  a partial example implementation is provided.
15034  Parameters:
15035  event - Identifies the type of event
15036  bufferHandle - Handle identifying the buffer to which the vent relates
15037  context - Value identifying the context of the application that registered
15038  the event handling function.
15039  Returns:
15040  None.
15041  Example:
15042  <code>
15043  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15044  DRV_USART_BUFFER_HANDLE bufferHandle,
15045  uintptr_t context )
15046  {
15047  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15048  switch(event)
15049  {
15050  case DRV_USART_BUFFER_EVENT_COMPLETE:
15051  // Handle the completed buffer.
15052  break;
15053  case DRV_USART_BUFFER_EVENT_ERROR:
15054  default:
15055  // Handle error.
15056  break;
15057  }
15058  }
15059  </code>
15060  Remarks:
15061  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15062  transferred successfully.
15063  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15064  transferred successfully. The DRV_USART_ErrorGet function can be called to
15065  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15066  called to find out how many bytes were processed.
15067  The bufferHandle parameter contains the buffer handle of the buffer that
15068  associated with the event.
15069  The context parameter contains the a handle to the client context,
15070  provided at the time the event handling function was registered using the
15071  DRV_USART_BufferEventHandlerSet function. This context handle value is
15072  passed back to the client as the "context" parameter. It can be any value
15073  necessary to identify the client context or instance (such as a pointer to
15074  the client's data) instance of the client that made the buffer add request.
15075  The event handler function executes in the driver peripheral's interrupt
15076  context when the driver is configured for interrupt mode operation. It is
15077  recommended of the application to not perform process intensive or blocking
15078  operations with in this function.
15079  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15080  be called in the event handler to add a buffer to the driver queue. These
15081  functions can only be called to add buffers to the driver whose event
15082  handler is running. For example, buffers cannot be added USART2 driver in
15083  USART1 driver event handler.
15084 */
15085 
15086 typedef
15088 DRV_USART_BUFFER_HANDLE bufferHandle ,
15089 uintptr_t context ) ;
15090 // *****************************************************************************
15091 /* USART Driver Byte Event Handler Function Pointer
15092  Summary
15093  Pointer to a USART Driver Byte Event handler function
15094  Description
15095  This data type defines the required function signature for the USART driver
15096  byte event handling callback function. A client must register a pointer to a
15097  byte event handling function whose function signature (parameter and return
15098  value types) match the types specified by this function pointer in order to
15099  receive byte related event calls back from the driver.
15100  Parameters:
15101  index - Identifier for the instance
15102  Returns:
15103  None.
15104  Example:
15105  <code>
15106  void APP_MyUsartTxEventHandler(void)
15107  {
15108  // Handle the transmit byte event
15109  }
15110  </code>
15111  Remarks:
15112  The event handler function executes in the driver peripheral's interrupt
15113  context when the driver is configured for interrupt mode operation. It is
15114  recommended that the application not perform process intensive or blocking
15115  operations with in this function.
15116 */
15117 
15118 typedef
15119 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15120 // *****************************************************************************
15121 /* USART Handshake Modes
15122  Summary:
15123  Identifies the handshaking modes supported by the USART driver.
15124  Description:
15125  This data type identifies the handshaking modes supported by the USART
15126  driver.
15127  Remarks:
15128  Not all modes are available on all devices. Refer to the specific device data
15129  sheet to determine availability.
15130 */
15131 
15132 typedef
15133  enum
15134  {
15135  /* Handshaking occurs in Flow Control Mode */
15136  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15137  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15138  ,
15139  /* Handshaking occurs in Simplex Mode */
15140  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15141  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15142  ,
15143  /* No Handshaking */
15144  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15145  2 /*DOM-IGNORE-END*/
15147 // *****************************************************************************
15148 /* USART Baud Set Result
15149  Summary:
15150  Identifies the results of the baud set function.
15151  Description:
15152  This data type identifies the results of the DRV_USART_BaudSet function.
15153  Remarks:
15154  None.
15155 */
15156 
15157 typedef
15158  enum
15159  {
15160  /* The driver was not able to change the baud */
15161  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15162  - 1 /*DOM-IGNORE-END*/
15163  ,
15164  /* The driver was able to change the baud successfully */
15167 // *****************************************************************************
15168 /* USART Line Control Set Result
15169  Summary:
15170  Identifies the results of the baud set function.
15171  Description:
15172  This data type identifies the results of the DRV_USART_LineControlSet
15173  function.
15174  Remarks:
15175  None.
15176 */
15177 
15178 typedef
15179  enum
15180  {
15181  /* The driver was not able to change the Line Control */
15182  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15183  - 1 /*DOM-IGNORE-END*/
15184  ,
15185  /* The driver was able to change the Line Control successfully */
15188 // *****************************************************************************
15189 /* USART Line Control Modes
15190  Summary:
15191  Identifies the line control modes supported by the USART driver.
15192  Description:
15193  This data type identifies the line control modes supported by the USART
15194  driver. Line control modes define the number of data bits, parity mode, and
15195  the number of stop bits in a USART transmit and receive frames.
15196  Remarks:
15197  The abbreviations used in the labels for the values of this enumeration
15198  follow the format <data><parity><stop>, where:
15199  <data> is the number of data bits
15200  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15201  added to obtain an even number of bits, or "ODD" for one bit
15202  added to obtain an odd number of bits.
15203  <stop> is the number of Stop bits
15204 */
15205 
15206 typedef
15207  enum
15208  {
15209  /* 8 data bits, no parity bit, 1 stop bit */
15210  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15211  USART_8N1 /* DOM-IGNORE-END*/
15212  ,
15213  /* 9 data bits, no parity bit, 1 stop bit */
15214  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15215  USART_9N1 /* DOM-IGNORE-END*/
15216  ,
15217  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15218  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15219  USART_8E1 /* DOM-IGNORE-END*/
15220  ,
15221  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15222  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15223  USART_8E2 /* DOM-IGNORE-END*/
15224  ,
15225  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15226  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15227  USART_8O1 /* DOM-IGNORE-END*/
15228  ,
15229  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15230  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15231  USART_8O2 /* DOM-IGNORE-END*/
15232  ,
15233  /* 8 data bits, no parity bit, 2 stop bit */
15234  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15235  USART_8N2 /* DOM-IGNORE-END*/
15236  ,
15237  /* 9 data bits, no parity bit, 2 stop bit */
15238  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15239  USART_9N2 /* DOM-IGNORE-END*/
15241 // *****************************************************************************
15242 /* USART Initialization flags
15243  Summary:
15244  Flags identifying features that can be enabled when the driver is
15245  initialized.
15246  Description:
15247  This enumeration defines flags identifying features that can be enabled
15248  when the driver is initialized.
15249  Remarks:
15250  These flags can be logically ORed together. They are passed into the
15251  DRV_USART_Initialize function through the "flags" member of the
15252  DRV_USART_INIT structure.
15253 */
15254 
15255 typedef
15256  enum
15257  {
15258  /* Use this if no flags need to be set */
15259  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15260  0 /*DOM-IGNORE-END*/
15261  ,
15262  /* Flag to enable "wake on start" operation. If supported and enabled,
15263  this feature will allow the USART to wake-up the device when a
15264  Start bit is received. This option should be selected only when the
15265  device is to placed in Sleep mode. Note that enabling this bit will
15266  also cause the first received character to be lost. Refer to the specific
15267  device data sheet for more information. */
15269  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15270  ,
15271  /* Flag to enable auto baud detection. If supported and enabled, this
15272  feature will allow the USART to automatically detect the baud rate in
15273  use. */
15274  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15275  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15276  ,
15277  /* Flag to enable stop in idle. If supported and enabled , this
15278  feature will allow the USART to stop when the CPU enters Idle
15279  mode */
15281  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15283 // *****************************************************************************
15284 /* Operation Mode Initialization Data
15285  Summary:
15286  Defines the initialization data required for different operation modes of
15287  USART.
15288  Description:
15289  This data type defines the initialization data required for different
15290  operation modes of the USART.
15291  Remarks:
15292  None
15293 */
15294 
15295 typedef
15296  union
15297  {
15298  /* Initialization for Addressed mode */
15299  struct
15300  {
15301  /* Address of the device. */
15302  uint8_t address ;
15303  } AddressedModeInit ;
15305 // *****************************************************************************
15306 /* USART Driver Errors.
15307  Summary:
15308  Defines the possible errors that can occur during driver operation.
15309  Description:
15310  This data type defines the possible errors that can occur when occur during
15311  USART driver operation. These values are returned by DRV_USART_ErrorGet
15312  function.
15313  Remarks:
15314  None
15315 */
15316 
15317 typedef
15318  enum
15319  {
15320  /* There was no error */
15322  /*DOM-IGNORE-BEGIN*/
15323  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15324  ,
15325  /* This indicates that a parity error has occurred */
15327  /*DOM-IGNORE-BEGIN*/
15328  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15329  ,
15330  /* This indicates that a framing error has occurred */
15332  /*DOM-IGNORE-BEGIN*/
15333  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15334  ,
15335  /* This indicates a receiver overflow has occurred */
15337  /*DOM-IGNORE-BEGIN*/
15338  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15339  ,
15340  /* Channel address error (Applicable in DMA mode) */
15341  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15342  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15343  } DRV_USART_ERROR ;
15344 // *****************************************************************************
15345 /* USART Client-Specific Driver Status
15346  Summary:
15347  Defines the client-specific status of the USART driver.
15348  Description:
15349  This enumeration defines the client-specific status codes of the USART
15350  driver.
15351  Remarks:
15352  Returned by the DRV_USART_ClientStatus function.
15353 */
15354 
15355 typedef
15356  enum
15357  {
15358  /* An error has occurred.*/
15360  /* The driver is closed, no operations for this client are ongoing,
15361  and/or the given handle is invalid. */
15363  /* The driver is currently busy and cannot start additional operations. */
15365  /* The module is running and ready for additional operations */
15368 // *****************************************************************************
15369 /* USART Driver Transfer Flags
15370  Summary
15371  Specifies the status of the receive or transmit
15372  Description
15373  This type specifies the status of the receive or transmit operation.
15374  Remarks:
15375  More than one of these values may be OR'd together to create a complete
15376  status value. To test a value of this type, the bit of interest must be
15377  ANDed with the value and checked to see if the result is non-zero.
15378 */
15379 
15380 typedef
15381  enum
15382  {
15383  /* Indicates that at least one byte of Data has been received */
15385  /*DOM-IGNORE-BEGIN*/
15386  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15387  ,
15388  /* Indicates that the core driver receiver buffer is empty */
15390  /*DOM-IGNORE-BEGIN*/
15391  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15392  ,
15393  /* Indicates that the core driver transmitter buffer is full */
15395  /*DOM-IGNORE-BEGIN*/
15396  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15397  ,
15398  /* Indicates that the core driver transmitter buffer is empty */
15400  /*DOM-IGNORE-BEGIN*/
15401  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15403 // *****************************************************************************
15404 /* USART Driver Initialization Data
15405  Summary:
15406  Defines the data required to initialize or reinitialize the USART driver
15407  Description:
15408  This data type defines the data required to initialize or reinitialize the
15409  USART driver. If the driver is built statically, the members of this data
15410  structure are statically over-ridden by static override definitions in the
15411  system_config.h file.
15412  Remarks:
15413  None.
15414 */
15415 
15416 typedef
15417  struct
15418  {
15419  /* System module initialization data */
15420  SYS_MODULE_INIT moduleInit ;
15421  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15422  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15423  system_config.h header file. */
15424  USART_MODULE_ID usartID ;
15425  /* Identifies the Operation mode of the USART driver. For a static build of
15426  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15427  system_config.h header file. */
15429  /* Data required by the operation mode of the driver. For a static build of
15430  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15431  system_config.h header file. */
15433  /* Flags to enable specific features. Refer to the
15434  description of DRV_USART_INIT_FLAGS for more details. For a static build
15435  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15436  system_config.h header file. */
15437  DRV_USART_INIT_FLAGS flags ;
15438  /* USART module Baud Rate Generator Clock. This typically
15439  the peripheral bus clock frequency. For a static build of the driver,
15440  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15441  header file. */
15442  uint32_t brgClock ;
15443  /* The initial USART line control settings. For a static build of the driver
15444  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15445  system_config.h header file. */
15446  DRV_USART_LINE_CONTROL lineControl ;
15447  /* Baud Rate value to be used, if not using auto baud. For a static build of
15448  the driver, this is overridden by the DRV_USART_BAUD macro in the
15449  system_config.h header file. */
15450  uint32_t baud ;
15451  /* Handshaking mode. For a static build of the driver, this is overridden by
15452  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15453  DRV_USART_HANDSHAKE handshake ;
15454  /* Lines enabled for the USART operation. For a static build of the driver,
15455  this is overridden by the DRV_USART_LINES_ENABLE macro in
15456  the system_config.h header file.
15457  For PPS parts, pin selection in ports overrides this. */
15458  USART_OPERATION_MODE linesEnable ;
15459  /* Interrupt source ID for the transmitter interrupt. For a static build of
15460  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15461  macro in the system_config.h header. */
15462  INT_SOURCE interruptTransmit ;
15463  /* Interrupt source ID for the receiver interrupt. For a static build of
15464  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15465  macro in the system_config.h header. */
15466  INT_SOURCE interruptReceive ;
15467  /* Interrupt source ID for the error Interrupt. For a static build of the
15468  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15469  in the system_config.h header. */
15470  INT_SOURCE interruptError ;
15471  /* This is the receive buffer queue size. This is the maximum
15472  number of read requests that driver will queue. For a
15473  static build of the driver, this is overridden by the
15474  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15475  unsigned int queueSizeReceive ;
15476  /* This is the transmit buffer queue size. This is the maximum
15477  number of write requests that driver will queue. For a
15478  static build of the driver, this is overridden by the
15479  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15480  unsigned int queueSizeTransmit ;
15481  /* This is the USART transmit DMA channel.
15482  For a static build of the driver, this is overridden by the
15483  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15484  DMA_CHANNEL dmaChannelTransmit ;
15485  /* This is the USART receive DMA channel.
15486  For a static build of the driver, this is overridden by the
15487  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15488  DMA_CHANNEL dmaChannelReceive ;
15489  /* This is the USART transmit DMA channel interrupt.
15490  For a static build of the driver, this is overridden by the
15491  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15492  INT_SOURCE dmaInterruptTransmit ;
15493  /* This is the USART receive DMA channel interrupt.
15494  For a static build of the driver, this is overridden by the
15495  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15496  INT_SOURCE dmaInterruptReceive ;
15497  } DRV_USART_INIT ;
15498 //DOM-IGNORE-BEGIN
15499 //DOM-IGNORE-END
15500  // #ifndef _DRV_USART_DEFINITIONS_H
15501 /*******************************************************************************
15502  End of File
15503 */
15504 
15505 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15506 /* CLOSE_FILE Include File */
15507 
15508 // DOM-IGNORE-BEGIN
15509 // DOM-IGNORE-END
15510 // *****************************************************************************
15511 // *****************************************************************************
15512 // Section: USART Driver Module Interface Routines
15513 // *****************************************************************************
15514 // *****************************************************************************
15515 // *****************************************************************************
15516 /* Function:
15517  SYS_MODULE_OBJ DRV_USART_Initialize
15518  (
15519  const SYS_MODULE_INDEX index,
15520  const SYS_MODULE_INIT * const init
15521  )
15522  Summary:
15523  Initializes the USART instance for the specified driver index.
15524  <p><b>Implementation:</b> Static/Dynamic</p>
15525  Description:
15526  This routine initializes the USART driver instance for the specified driver
15527  index, making it ready for clients to open and use it. The initialization
15528  data is specified by the init parameter. The initialization may fail if the
15529  number of driver objects allocated are insufficient or if the specified
15530  driver instance is already initialized. The driver instance index is
15531  independent of the USART module ID. For example, driver instance 0 can be
15532  assigned to USART2. If the driver is built statically, then some of the
15533  initialization parameters are overridden by configuration macros. Refer to
15534  the description of the DRV_USART_INIT data structure for more details on
15535  which members on this data structure are overridden.
15536  Precondition:
15537  None.
15538  Parameters:
15539  index - Identifier for the instance to be initialized
15540  init - Pointer to a data structure containing any data necessary to
15541  initialize the driver.
15542  Returns:
15543  If successful, returns a valid handle to a driver instance object.
15544  Otherwise, returns SYS_MODULE_OBJ_INVALID.
15545  Example:
15546  <code>
15547  // The following code snippet shows an example USART driver initialization.
15548  // The driver is initialized for normal mode and a baud of 300. The
15549  // receive queue size is set to 2 and transmit queue size is set to 3.
15550  DRV_USART_INIT usartInit;
15551  SYS_MODULE_OBJ objectHandle;
15552  usartInit.baud = 300;
15553  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
15554  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
15555  usartInit.usartID = USART_ID_2;
15556  usartInit.brgClock = 80000000;
15557  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
15558  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
15559  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
15560  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
15561  usartInit.queueSizeReceive = 2;
15562  usartInit.queueSizeTransmit = 3;
15563  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
15564  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
15565  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
15566  if (SYS_MODULE_OBJ_INVALID == objectHandle)
15567  {
15568  // Handle error
15569  }
15570  </code>
15571  Remarks:
15572  This routine must be called before any other USART routine is called.
15573  This routine should only be called once during system initialization
15574  unless DRV_USART_Deinitialize is called to deinitialize the driver
15575  instance. This routine will NEVER block for hardware access.
15576 */
15577 
15578 SYS_MODULE_OBJ
15580  const SYS_MODULE_INDEX index ,
15581  const SYS_MODULE_INIT * const init ) ;
15582 // *****************************************************************************
15583 /* Function:
15584  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
15585  Summary:
15586  Deinitializes the specified instance of the USART driver module.
15587  <p><b>Implementation:</b> Static/Dynamic</p>
15588  Description:
15589  Deinitializes the specified instance of the USART driver module, disabling
15590  its operation (and any hardware). Invalidates all the internal data.
15591  Precondition:
15592  Function DRV_USART_Initialize should have been called before calling this
15593  function.
15594  Parameters:
15595  object - Driver object handle, returned from the
15596  DRV_USART_Initialize routine
15597  Returns:
15598  None.
15599  Example:
15600  <code>
15601  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15602  SYS_STATUS status;
15603  DRV_USART_Deinitialize(object);
15604  status = DRV_USART_Status(object);
15605  if (SYS_MODULE_DEINITIALIZED != status)
15606  {
15607  // Check again later if you need to know
15608  // when the driver is deinitialized.
15609  }
15610  </code>
15611  Remarks:
15612  Once the Initialize operation has been called, the Deinitialize operation
15613  must be called before the Initialize operation can be called again. This
15614  routine will NEVER block waiting for hardware.
15615 */
15616 
15617 void
15619  SYS_MODULE_OBJ object ) ;
15620 // *****************************************************************************
15621 /* Function:
15622  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
15623  Summary:
15624  Gets the current status of the USART driver module.
15625  <p><b>Implementation:</b> Static/Dynamic</p>
15626  Description:
15627  This routine provides the current status of the USART driver module.
15628  Precondition:
15629  Function DRV_USART_Initialize should have been called before calling this
15630  function.
15631  Parameters:
15632  object - Driver object handle, returned from the
15633  DRV_USART_Initialize routine
15634  Returns:
15635  SYS_STATUS_READY - Indicates that the driver is busy with a
15636  previous system level operation and cannot start
15637  another
15638  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
15639  deinitialized
15640  Example:
15641  <code>
15642  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15643  SYS_STATUS usartStatus;
15644  usartStatus = DRV_USART _Status(object);
15645  if (SYS_STATUS_READY == usartStatus)
15646  {
15647  // This means the driver can be opened using the
15648  // DRV_USART_Open() function.
15649  }
15650  </code>
15651  Remarks:
15652  A driver can opened only when its status is SYS_STATUS_READY.
15653 */
15654 
15655 SYS_STATUS
15657  SYS_MODULE_OBJ object ) ;
15658 // *****************************************************************************
15659 /* Function:
15660  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
15661  Summary:
15662  Maintains the driver's transmit state machine and implements its ISR.
15663  <p><b>Implementation:</b> Static/Dynamic</p>
15664  Description:
15665  This routine is used to maintain the driver's internal transmit state
15666  machine and implement its transmit ISR for interrupt-driven implementations.
15667  In polling mode, this function should be called from the SYS_Tasks
15668  function. In interrupt mode, this function should be called in the transmit
15669  interrupt service routine of the USART that is associated with this USART
15670  driver hardware instance.
15671  Precondition:
15672  The DRV_USART_Initialize routine must have been called for the specified
15673  USART driver instance.
15674  Parameters:
15675  object - Object handle for the specified driver instance (returned from
15676  DRV_USART_Initialize)
15677  Returns:
15678  None.
15679  Example:
15680  <code>
15681  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15682  while (true)
15683  {
15684  DRV_USART_TasksTransmit (object);
15685  // Do other tasks
15686  }
15687  </code>
15688  Remarks:
15689  This routine is normally not called directly by an application. It is
15690  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15691  ISR.
15692  This routine may execute in an ISR context and will never block or access any
15693  resources that may cause it to block.
15694 */
15695 
15696 void
15698  SYS_MODULE_OBJ object ) ;
15699 // *****************************************************************************
15700 /* Function:
15701  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
15702  Summary:
15703  Maintains the driver's receive state machine and implements its ISR.
15704  <p><b>Implementation:</b> Static/Dynamic</p>
15705  Description:
15706  This routine is used to maintain the driver's internal receive state machine
15707  and implement its receive ISR for interrupt-driven implementations. In
15708  polling mode, this function should be called from the SYS_Tasks function.
15709  In interrupt mode, this function should be called in the receive interrupt
15710  service routine of the USART that is associated with this USART driver
15711  hardware instance.
15712  Precondition:
15713  The DRV_USART_Initialize routine must have been called for the specified
15714  USART driver instance.
15715  Parameters:
15716  object - Object handle for the specified driver instance (returned from
15717  DRV_USART_Initialize)
15718  Returns:
15719  None.
15720  Example:
15721  <code>
15722  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15723  while (true)
15724  {
15725  DRV_USART_TasksReceive (object);
15726  // Do other tasks
15727  }
15728  </code>
15729  Remarks:
15730  This routine is normally not called directly by an application. It is
15731  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15732  ISR.
15733  This routine may execute in an ISR context and will never block or access any
15734  resources that may cause it to block.
15735 */
15736 
15737 void
15739  SYS_MODULE_OBJ object ) ;
15740 // *****************************************************************************
15741 /* Function:
15742  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
15743  Summary:
15744  Maintains the driver's error state machine and implements its ISR.
15745  <p><b>Implementation:</b> Static/Dynamic</p>
15746  Description:
15747  This routine is used to maintain the driver's internal error state machine
15748  and implement its error ISR for interrupt-driven implementations. In
15749  polling mode, this function should be called from the SYS_Tasks function.
15750  In interrupt mode, this function should be called in the error interrupt
15751  service routine of the USART that is associated with this USART driver
15752  hardware instance.
15753  Precondition:
15754  The DRV_USART_Initialize routine must have been called for the specified
15755  USART driver instance.
15756  Parameters:
15757  object - Object handle for the specified driver instance (returned from
15758  DRV_USART_Initialize)
15759  Returns:
15760  None.
15761  Example:
15762  <code>
15763  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15764  while (true)
15765  {
15766  DRV_USART_TasksError (object);
15767  // Do other tasks
15768  }
15769  </code>
15770  Remarks:
15771  This routine is normally not called directly by an application. It is
15772  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15773  ISR.
15774  This routine may execute in an ISR context and will never block or access any
15775  resources that may cause it to block.
15776 */
15777 
15778 void
15780  SYS_MODULE_OBJ object ) ;
15781 // *****************************************************************************
15782 // *****************************************************************************
15783 // Section: USART Driver Client Routines
15784 // *****************************************************************************
15785 // *****************************************************************************
15786 // *****************************************************************************
15787 /* Function:
15788  DRV_HANDLE DRV_USART_Open
15789  (
15790  const SYS_MODULE_INDEX index,
15791  const DRV_IO_INTENT ioIntent
15792  )
15793  Summary:
15794  Opens the specified USART driver instance and returns a handle to it.
15795  <p><b>Implementation:</b> Static/Dynamic</p>
15796  Description:
15797  This routine opens the specified USART driver instance and provides a
15798  handle that must be provided to all other client-level operations to
15799  identify the caller and the instance of the driver. The ioIntent
15800  parameter defines how the client interacts with this driver instance.
15801  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
15802  additionally affect the behavior of the DRV_USART_Read and
15803  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
15804  then these function will not block even if the required amount of data could
15805  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
15806  will block until the required amount of data is processed. If the driver is
15807  configured for polling and bare-metal operation, it will not support
15808  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
15809  non-blocking.
15810  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
15811  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
15812  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
15813  client will be able to do both, read and write.
15814  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
15815  exclusive access to this client. The driver cannot be opened by any
15816  other client.
15817  Precondition:
15818  Function DRV_USART_Initialize must have been called before calling this
15819  function.
15820  Parameters:
15821  index - Identifier for the object instance to be opened
15822  intent - Zero or more of the values from the enumeration
15823  DRV_IO_INTENT "ORed" together to indicate the intended use
15824  of the driver. See function description for details.
15825  Returns:
15826  If successful, the routine returns a valid open-instance handle (a number
15827  identifying both the caller and the module instance).
15828  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
15829  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
15830  insufficient.
15831  - if the client is trying to open the driver but driver has been opened
15832  exclusively by another client.
15833  - if the driver hardware instance being opened is not initialized or is
15834  invalid.
15835  - if the client is trying to open the driver exclusively, but has already
15836  been opened in a non exclusive mode by another client.
15837  - if the driver is not ready to be opened, typically when the initialize
15838  routine has not completed execution.
15839  Example:
15840  <code>
15841  DRV_HANDLE handle;
15842  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
15843  if (DRV_HANDLE_INVALID == handle)
15844  {
15845  // Unable to open the driver
15846  // May be the driver is not initialized or the initialization
15847  // is not complete.
15848  }
15849  </code>
15850  Remarks:
15851  The handle returned is valid until the DRV_USART_Close routine is called.
15852  This routine will NEVER block waiting for hardware.If the requested intent
15853  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
15854  function is thread safe in a RTOS application.
15855 */
15856 
15857 DRV_HANDLE
15858  DRV_USART_Open (
15859  const SYS_MODULE_INDEX index ,
15860  const DRV_IO_INTENT ioIntent ) ;
15861 // *****************************************************************************
15862 /* Function:
15863  void DRV_USART_Close( DRV_Handle handle )
15864  Summary:
15865  Closes an opened-instance of the USART driver.
15866  <p><b>Implementation:</b> Static/Dynamic</p>
15867  Description:
15868  This routine closes an opened-instance of the USART driver, invalidating the
15869  handle. Any buffers in the driver queue that were submitted by this client
15870  will be removed. After calling this routine, the handle passed in "handle"
15871  must not be used with any of the remaining driver routines (with one
15872  possible exception described in the "Remarks" section). A new handle must
15873  be obtained by calling DRV_USART_Open before the caller may use the driver
15874  again
15875  Precondition:
15876  The DRV_USART_Initialize routine must have been called for the specified
15877  USART driver instance.
15878  DRV_USART_Open must have been called to obtain a valid opened device handle.
15879  Parameters:
15880  handle - A valid open-instance handle, returned from the driver's
15881  open routine
15882  Returns:
15883  None.
15884  Example:
15885  <code>
15886  DRV_HANDLE handle; // Returned from DRV_USART_Open
15887  DRV_USART_Close(handle);
15888  // After this point, the handle cannot be used with any other function
15889  // except the DRV_USART_ClientStatus function, which can be used to query
15890  // the success status of the DRV_USART_Close function.
15891  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
15892  </code>
15893  Remarks:
15894  Usually there is no need for the client to verify that the Close operation
15895  has completed. The driver will abort any ongoing operations when this
15896  routine is called. However, if it requires additional time to do so in a
15897  non-blocking environment, it will still return from the Close operation but
15898  the handle is now a zombie handle. The client can only call the
15899  DRV_USART_ClientStatus on a zombie handle to track the completion of the
15900  Close operation. The DRV_USART_ClientStatus routine will return
15901  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
15902 */
15903 
15904 void
15905  DRV_USART_Close (
15906  const DRV_HANDLE handle ) ;
15907 // *****************************************************************************
15908 /*
15909  Function:
15910  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
15911  Summary:
15912  Gets the current client-specific status the USART driver.
15913  <p><b>Implementation:</b> Static/Dynamic</p>
15914  Description:
15915  This function gets the client-specific status of the USART driver associated
15916  with the given handle. This function can be used to check the status of
15917  client after the DRV_USART_Close() function has been called.
15918  Preconditions:
15919  The DRV_USART_Initialize function must have been called.
15920  DRV_USART_Open must have been called to obtain a valid opened device
15921  handle.
15922  Parameters:
15923  handle - Handle returned from the driver's open function.
15924  Returns:
15925  A DRV_USART_CLIENT_STATUS value describing the current status of the
15926  driver.
15927  Example:
15928  <code>
15929  DRV_HANDLE handle; // Returned from DRV_USART_Open
15930  DRV_USART_CLIENT_STATUS status;
15931  status = DRV_USART_ClientStatus(handle);
15932  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
15933  {
15934  // The client had not closed.
15935  }
15936  </code>
15937  Remarks:
15938  This function will not block for hardware access and will immediately return
15939  the current status. This function is thread safe when called in a RTOS
15940  application.
15941 */
15942 
15945  DRV_HANDLE handle ) ;
15946 // *****************************************************************************
15947 // *****************************************************************************
15948 // Section: USART Driver Buffer Queuing Model Interface Routines
15949 // *****************************************************************************
15950 // *****************************************************************************
15951 // *****************************************************************************
15952 /* Function:
15953  void DRV_USART_BufferAddWrite
15954  (
15955  const DRV_HANDLE handle,
15956  DRV_USART_BUFFER_HANDLE * bufferHandle,
15957  void * buffer,
15958  size_t size
15959  );
15960  Summary:
15961  Schedule a non-blocking driver write operation.
15962  <p><b>Implementation:</b> Static/Dynamic</p>
15963  Description:
15964  This function schedules a non-blocking write operation. The function returns
15965  with a valid buffer handle in the bufferHandle argument if the write request
15966  was scheduled successfully. The function adds the request to the hardware
15967  instance transmit queue and returns immediately. While the request is in the
15968  queue, the application buffer is owned by the driver and should not be
15969  modified. On returning, the bufferHandle parameter may be
15970  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
15971  - if a buffer could not be allocated to the request
15972  - if the input buffer pointer is NULL
15973  - if the client opened the driver for read-only
15974  - if the buffer size is 0
15975  - if the transmit queue is full or the queue depth is insufficient
15976  If the requesting client registered an event callback with the driver, the
15977  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
15978  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
15979  was not processed successfully.
15980  Precondition:
15981  The DRV_USART_Initialize routine must have been called for the specified
15982  USART device instance and the DRV_USART_Status must have returned
15983  SYS_STATUS_READY.
15984  DRV_USART_Open must have been called to obtain a valid opened device handle.
15985  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
15986  the DRV_USART_Open call.
15987  Parameters:
15988  handle - Handle of the communication channel as return by the
15989  DRV_USART_Open function.
15990  bufferHandle - Pointer to an argument that will contain the return buffer handle.
15991  buffer - Data to be transmitted.
15992  size - Buffer size in bytes.
15993  Returns:
15994  The bufferHandle parameter will contain the return buffer handle. This will be
15995  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
15996  Example:
15997  <code>
15998  MY_APP_OBJ myAppObj;
15999  uint8_t mybuffer[MY_BUFFER_SIZE];
16000  DRV_USART_BUFFER_HANDLE bufferHandle;
16001  // myUSARTHandle is the handle returned
16002  // by the DRV_USART_Open function.
16003  // Client registers an event handler with driver
16004  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16005  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16006  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16007  myBuffer, MY_BUFFER_SIZE);
16008  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16009  {
16010  // Error handling here
16011  }
16012  // Event is received when
16013  // the buffer is processed.
16014  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16015  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16016  {
16017  // contextHandle points to myAppObj.
16018  switch(event)
16019  {
16020  case DRV_USART_BUFFER_EVENT_COMPLETE:
16021  // This means the data was transferred.
16022  break;
16023  case DRV_USART_BUFFER_EVENT_ERROR:
16024  // Error handling here.
16025  break;
16026  default:
16027  break;
16028  }
16029  }
16030  </code>
16031  Remarks:
16032  This function is thread safe in a RTOS application. It can be called from
16033  within the USART Driver Buffer Event Handler that is registered by this
16034  client. It should not be called in the event handler associated with another
16035  USART driver instance. It should not otherwise be called directly in an ISR.
16036 */
16037 
16038 void
16040  const DRV_HANDLE handle ,
16041  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16042  void * buffer ,
16043  const size_t size ) ;
16044 // *****************************************************************************
16045 /* Function:
16046  void DRV_USART_AddressedBufferAddWrite
16047  (
16048  const DRV_HANDLE hClient,
16049  DRV_USART_BUFFER_HANDLE * bufferHandle,
16050  uint8_t address,
16051  void * source,
16052  size_t nWords
16053  );
16054  Summary:
16055  Schedule a non-blocking addressed driver write operation.
16056  <p><b>Implementation:</b> Dynamic</p>
16057  Description:
16058  This function schedules a non-blocking addressed write operation. The function returns
16059  with a valid buffer handle in the bufferHandle argument if the addressed write request
16060  was scheduled successfully. The function adds the request to the hardware
16061  instance transmit queue and returns immediately. While the request is in the
16062  queue, the application buffer is owned by the driver and should not be
16063  modified. On returning, the bufferHandle parameter may be
16064  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16065  - if a buffer could not be allocated to the request
16066  - if the input buffer pointer is NULL
16067  - if the client opened the driver for read-only
16068  - if the buffer size is 0
16069  - if the transmit queue is full or the queue depth is insufficient
16070  If the requesting client registered an event callback with the driver, the
16071  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16072  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16073  was not processed successfully.
16074  Precondition:
16075  The DRV_USART_Initialize routine must have been called for the specified
16076  USART device instance and the DRV_USART_Status must have returned
16077  SYS_STATUS_READY.
16078  DRV_USART_Open must have been called to obtain a valid opened device handle.
16079  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16080  the DRV_USART_Open call.
16081  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16082  Parameters:
16083  hClient - Handle of the communication channel as return by the
16084  DRV_USART_Open function.
16085  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16086  address - Address of the receiver client
16087  source - Data to be transmitted.
16088  size - Buffer size in 16-bit words.
16089  Returns:
16090  The bufferHandle parameter will contain the return buffer handle. This will be
16091  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16092  Example:
16093  <code>
16094  MY_APP_OBJ myAppObj;
16095  uint16_t mybuffer[MY_BUFFER_SIZE];
16096  DRV_USART_BUFFER_HANDLE bufferHandle;
16097  uint8_t clientAddress;
16098  // myUSARTHandle is the handle returned
16099  // by the DRV_USART_Open function.
16100  // Client registers an event handler with driver
16101  clientAddress = 0x60;
16102  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16103  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16104  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16105  myBuffer, MY_BUFFER_SIZE);
16106  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16107  {
16108  // Error handling here
16109  }
16110  // Event is received when
16111  // the buffer is processed.
16112  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16113  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16114  {
16115  // contextHandle points to myAppObj.
16116  switch(event)
16117  {
16118  case DRV_USART_BUFFER_EVENT_COMPLETE:
16119  // This means the data was transferred.
16120  break;
16121  case DRV_USART_BUFFER_EVENT_ERROR:
16122  // Error handling here.
16123  break;
16124  default:
16125  break;
16126  }
16127  }
16128  </code>
16129  Remarks:
16130  This function is thread safe in a RTOS application. It can be called from
16131  within the USART Driver Buffer Event Handler that is registered by this
16132  client. It should not be called in the event handler associated with another
16133  USART driver instance. It should not otherwise be called directly in an ISR.
16134  The source buffer should be a 16-bit word aligned buffer.
16135  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16136 */
16137 
16138 void
16140  const DRV_HANDLE hClient ,
16141  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16142  uint8_t address ,
16143  void * source ,
16144  size_t nWords ) ;
16145 // *****************************************************************************
16146 /* Function:
16147  void DRV_USART_BufferAddRead
16148  (
16149  const DRV_HANDLE handle,
16150  DRV_USART_BUFFER_HANDLE * bufferHandle,
16151  void * buffer,
16152  const size_t size
16153  )
16154  Summary:
16155  Schedule a non-blocking driver read operation.
16156  <p><b>Implementation:</b> Static/Dynamic</p>
16157  Description:
16158  This function schedules a non-blocking read operation. The function returns
16159  with a valid buffer handle in the bufferHandle argument if the read request
16160  was scheduled successfully. The function adds the request to the hardware
16161  instance receive queue and returns immediately. While the request is in the
16162  queue, the application buffer is owned by the driver and should not be
16163  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16164  bufferHandle argument:
16165  - if a buffer could not be allocated to the request
16166  - if the input buffer pointer is NULL
16167  - if the buffer size is 0
16168  - if the read queue size is full or queue depth is insufficient.
16169  - if the driver handle is invalid
16170  If the requesting client registered an event callback with the driver, the
16171  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16172  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16173  was not processed successfully.
16174  Precondition:
16175  The DRV_USART_Initialize routine must have been called for the specified
16176  USART device instance and the DRV_USART_Status must have returned
16177  SYS_STATUS_READY.
16178  DRV_USART_Open must have been called to obtain a valid opened device handle.
16179  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16180  the DRV_USART_Open call.
16181  Parameters:
16182  handle - Handle of the communication channel as returned by the
16183  DRV_USART_Open function.
16184  buffer - Buffer where the received data will be stored.
16185  size - Buffer size in bytes.
16186  Returns:
16187  The buffer handle is returned in the bufferHandle argument. This is
16188  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16189  Example:
16190  <code>
16191  MY_APP_OBJ myAppObj;
16192  uint8_t mybuffer[MY_BUFFER_SIZE];
16193  DRV_USART_BUFFER_HANDLE bufferHandle;
16194  // myUSARTHandle is the handle returned
16195  // by the DRV_USART_Open function.
16196  // Client registers an event handler with driver
16197  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16198  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16199  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16200  myBuffer, MY_BUFFER_SIZE);
16201  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16202  {
16203  // Error handling here
16204  }
16205  // Event is received when
16206  // the buffer is processed.
16207  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16208  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16209  {
16210  // contextHandle points to myAppObj.
16211  switch(event)
16212  {
16213  case DRV_USART_BUFFER_EVENT_COMPLETE:
16214  // This means the data was transferred.
16215  break;
16216  case DRV_USART_BUFFER_EVENT_ERROR:
16217  // Error handling here.
16218  break;
16219  default:
16220  break;
16221  }
16222  }
16223  </code>
16224  Remarks:
16225  This function is thread safe in a RTOS application. It can be called from
16226  within the USART Driver Buffer Event Handler that is registered by the
16227  client. It should not be called in the event handler associated with another
16228  USART driver instance. It should not be called directly in an ISR.
16229 */
16230 
16231 void
16233  const DRV_HANDLE handle ,
16234  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16235  void * buffer ,
16236  const size_t size ) ;
16237 // *****************************************************************************
16238 /* Function:
16239  void DRV_USART_BufferEventHandlerSet
16240  (
16241  const DRV_HANDLE handle,
16242  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16243  const uintptr_t context
16244  )
16245  Summary:
16246  Allows a client to identify a buffer event handling function for the driver
16247  to call back when queued buffer transfers have finished.
16248  <p><b>Implementation:</b> Static/Dynamic</p>
16249  Description:
16250  This function allows a client to identify a buffer event handling function
16251  for the driver to call back when queued buffer transfers have finished.
16252  When a client calls either the DRV_USART_BufferAddRead or
16253  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16254  the buffer that was added to the driver's buffer queue. The driver will
16255  pass this handle back to the client by calling "eventHandler" function when
16256  the buffer transfer has completed.
16257  The event handler should be set before the client performs any "buffer add"
16258  operations that could generate events. The event handler once set, persists
16259  until the client closes the driver or sets another event handler (which
16260  could be a "NULL" pointer to indicate no callback).
16261  Precondition:
16262  The DRV_USART_Initialize routine must have been called for the specified
16263  USART driver instance.
16264  DRV_USART_Open must have been called to obtain a valid opened device handle.
16265  Parameters:
16266  handle - A valid open-instance handle, returned from the driver's
16267  open routine
16268  eventHandler - Pointer to the event handler function.
16269  context - The value of parameter will be passed back to the client
16270  unchanged, when the eventHandler function is called. It can
16271  be used to identify any client specific data object that
16272  identifies the instance of the client module (for example,
16273  it may be a pointer to the client module's state structure).
16274  Returns:
16275  None.
16276  Example:
16277  <code>
16278  // myAppObj is an application specific state data object.
16279  MY_APP_OBJ myAppObj;
16280  uint8_t mybuffer[MY_BUFFER_SIZE];
16281  DRV_USART_BUFFER_HANDLE bufferHandle;
16282  // myUSARTHandle is the handle returned
16283  // by the DRV_USART_Open function.
16284  // Client registers an event handler with driver. This is done once
16285  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16286  (uintptr_t)&myAppObj );
16287  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16288  myBuffer, MY_BUFFER_SIZE);
16289  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16290  {
16291  // Error handling here
16292  }
16293  // Event Processing Technique. Event is received when
16294  // the buffer is processed.
16295  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16296  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16297  {
16298  // The context handle was set to an application specific
16299  // object. It is now retrievable easily in the event handler.
16300  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16301  switch(event)
16302  {
16303  case DRV_USART_BUFFER_EVENT_COMPLETE:
16304  // This means the data was transferred.
16305  break;
16306  case DRV_USART_BUFFER_EVENT_ERROR:
16307  // Error handling here.
16308  break;
16309  default:
16310  break;
16311  }
16312  }
16313  </code>
16314  Remarks:
16315  If the client does not want to be notified when the queued buffer transfer
16316  has completed, it does not need to register a callback. This function is
16317  thread safe when called in a RTOS application.
16318 */
16319 
16320 void
16322  const DRV_HANDLE handle ,
16323  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16324  const uintptr_t context ) ;
16325 // *****************************************************************************
16326 /* Function:
16327  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16328  Summary:
16329  Removes a requested buffer from the queue.
16330  <p><b>Implementation:</b> Static/Dynamic</p>
16331  Description:
16332  This function removes a specified buffer from the queue.
16333  The client can use this function to delete
16334  1. An unwated stalled buffer.
16335  2. Queued buffers on timeout.
16336  or in any other use case.
16337  Precondition:
16338  The DRV_USART_Initialize routine must have been called for the specified
16339  USART driver instance.
16340  DRV_USART_Open must have been called to obtain a valid opened device handle.
16341  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16342  must have been called and a valid buffer handle returned.
16343  Parameters:
16344  bufferhandle - Handle of the buffer to delete.
16345  Returns:
16346  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16347  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16348  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16349  queue successfully.
16350  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16351  the queue because of mutex timeout in RTOS environment.
16352  Example:
16353  <code>
16354  // myAppObj is an application specific object.
16355  MY_APP_OBJ myAppObj;
16356  uint8_t mybuffer[MY_BUFFER_SIZE];
16357  DRV_USART_BUFFER_HANDLE bufferHandle;
16358  // myUSARTHandle is the handle returned
16359  // by the DRV_USART_Open function.
16360  // Client registers an event handler with driver. This is done once
16361  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16362  (uintptr_t)&myAppObj );
16363  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16364  myBuffer, MY_BUFFER_SIZE );
16365  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16366  {
16367  // Error handling here
16368  }
16369  // Event Processing Technique. Event is received when
16370  // the buffer is processed.
16371  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16372  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16373  {
16374  switch(event)
16375  {
16376  case DRV_USART_BUFFER_EVENT_COMPLETE:
16377  // This means the data was transferred.
16378  break;
16379  case DRV_USART_BUFFER_EVENT_ERROR:
16380  // Error handling here.
16381  break;
16382  default:
16383  break;
16384  }
16385  }
16386  // Timeout function, where remove queued buffer if it still exists.
16387  void APP_TimeOut(void)
16388  {
16389  DRV_USART_BUFFER_RESULT bufferResult;
16390  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16391  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16392  {
16393  //Buffer removed succesfully from the queue
16394  }
16395  else
16396  {
16397  //Either buffer is invalid or expired.
16398  //Or not able to acquire mutex in RTOS mode.
16399  }
16400  }
16401  </code>
16402  Remarks:
16403  This function is thread safe when used in a RTOS application.
16404 */
16405 
16408  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16409 // *****************************************************************************
16410 /* Function:
16411  size_t DRV_USART_BufferCompletedBytesGet
16412  (
16413  DRV_USART_BUFFER_HANDLE bufferHandle
16414  );
16415  Summary:
16416  Returns the number of bytes that have been processed for the
16417  specified buffer.
16418  <p><b>Implementation:</b> Static/Dynamic</p>
16419  Description:
16420  This function returns number of bytes that have been processed for the
16421  specified buffer. The client can use this function, in a case where the
16422  buffer has terminated due to an error, to obtain the number of bytes that
16423  have been processed. Or in any other use case.
16424  This function can be used for non-DMA buffer transfers only. It cannot be
16425  used when the USART driver is configured to use DMA.
16426  Precondition:
16427  The DRV_USART_Initialize routine must have been called for the specified
16428  USART driver instance.
16429  DRV_USART_Open must have been called to obtain a valid opened device handle.
16430  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16431  must have been called and a valid buffer handle returned.
16432  Parameters:
16433  bufferhandle - Handle for the buffer of which the processed number of bytes
16434  to be obtained.
16435  Returns:
16436  Returns the number of bytes that have been processed for this buffer.
16437  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16438  buffer handle.
16439  Example:
16440  <code>
16441  // myAppObj is an application specific object.
16442  MY_APP_OBJ myAppObj;
16443  uint8_t mybuffer[MY_BUFFER_SIZE];
16444  DRV_USART_BUFFER_HANDLE bufferHandle;
16445  // myUSARTHandle is the handle returned
16446  // by the DRV_USART_Open function.
16447  // Client registers an event handler with driver. This is done once
16448  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16449  (uintptr_t)&myAppObj );
16450  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16451  myBuffer, MY_BUFFER_SIZE );
16452  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16453  {
16454  // Error handling here
16455  }
16456  // Event Processing Technique. Event is received when
16457  // the buffer is processed.
16458  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16459  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16460  {
16461  // The context handle was set to an application specific
16462  // object. It is now retrievable easily in the event handler.
16463  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16464  size_t processedBytes;
16465  switch(event)
16466  {
16467  case DRV_USART_BUFFER_EVENT_COMPLETE:
16468  // This means the data was transferred.
16469  break;
16470  case DRV_USART_BUFFER_EVENT_ERROR:
16471  // Error handling here.
16472  // We can find out how many bytes were processed in this
16473  // buffer before the error occurred.
16474  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16475  break;
16476  default:
16477  break;
16478  }
16479  }
16480  </code>
16481  Remarks:
16482  This function is thread safe when used in a RTOS application.
16483 */
16484 
16485 size_t
16487  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16488 // *****************************************************************************
16489 /* Function:
16490  size_t DRV_USART_BufferProcessedSizeGet
16491  (
16492  DRV_USART_BUFFER_HANDLE bufferHandle
16493  );
16494  Summary:
16495  This API will be deprecated and not recommended to use.
16496  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16497  processed for the specified buffer.
16498  Description:
16499  None.
16500  Precondition:
16501  None.
16502  Parameters:
16503  None.
16504  Returns:
16505  None.
16506  Example:
16507  None.
16508  Remarks:
16509  None.
16510 */
16511 
16512 size_t
16514  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16515 // *****************************************************************************
16516 // *****************************************************************************
16517 // Section: USART Driver File System Model Routines
16518 // *****************************************************************************
16519 // *****************************************************************************
16520 // *****************************************************************************
16521 /* Function:
16522  size_t DRV_USART_Read
16523  (
16524  const DRV_HANDLE handle,
16525  void * buffer,
16526  const size_t numbytes
16527  )
16528  Summary:
16529  Reads data from the USART.
16530  <p><b>Implementation:</b> Static/Dynamic</p>
16531  Description:
16532  This routine reads data from the USART. This function is blocking if the
16533  driver was opened by the client for blocking operation. This function will
16534  not block if the driver was opened by the client for non blocking operation.
16535  If the ioIntent parameter at the time of opening the driver was
16536  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16537  until) numbytes of bytes have been received or if an error occurred. If there
16538  are buffers queued for receiving data, these buffers will be serviced first. The
16539  function will not return until the requested number of bytes have been read.
16540  If the ioIntent parameter at the time of opening the driver was
16541  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16542  bytes that were actually read. The function will not wait until numBytes of
16543  bytes have been read. If there are buffer queued for reading data, then the
16544  function will not block and will return immediately with 0 bytes read.
16545  Precondition:
16546  The DRV_USART_Initialize routine must have been called for the specified
16547  USART driver instance.
16548  DRV_USART_Open must have been called to obtain a valid opened device handle.
16549  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16550  the DRV_USART_Open call.
16551  Parameters:
16552  handle - A valid open-instance handle, returned from the driver's
16553  open routine
16554  buffer - Buffer into which the data read from the USART instance
16555  will be placed.
16556  numbytes - Total number of bytes that need to be read from the module
16557  instance (must be equal to or less than the size of the
16558  buffer)
16559  Returns:
16560  Number of bytes actually copied into the caller's buffer. Returns
16561  DRV_USART_READ_ERROR in case of an error.
16562  Example:
16563  <code>
16564  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16565  char myBuffer[MY_BUFFER_SIZE];
16566  unsigned int count;
16567  unsigned int total;
16568  total = 0;
16569  do
16570  {
16571  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
16572  if(count == DRV_USART_READ_ERROR)
16573  {
16574  // There was an error. The DRV_USART_ErrorGet() function
16575  // can be called to find the exact error.
16576  }
16577  total += count;
16578  // Do something else...
16579  } while( total < MY_BUFFER_SIZE );
16580  </code>
16581  Remarks:
16582  This function is thread safe in a RTOS application. If the driver is
16583  configured for polled operation, this it will not support blocking operation
16584  in a bare metal (non-RTOS) application.
16585 */
16586 
16587 size_t
16588  DRV_USART_Read (
16589  const DRV_HANDLE handle ,
16590  void * buffer ,
16591  const size_t numbytes ) ;
16592 // *****************************************************************************
16593 /* Function:
16594  size_t DRV_USART_Write
16595  (
16596  const DRV_HANDLE handle,
16597  void * buffer,
16598  const size_t numbytes
16599  )
16600  Summary:
16601  Writes data to the USART.
16602  <p><b>Implementation:</b> Static/Dynamic</p>
16603  Description:
16604  This routine writes data to the USART. This function is blocking if the
16605  driver was opened by the client for blocking operation. This function will
16606  not block if the driver was opened by the client for non blocking operation.
16607  If the ioIntent parameter at the time of opening the driver was
16608  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16609  until) numbytes of bytes have been transmitted or if an error occurred. If
16610  there are buffers queued for writing, the function will wait until all the
16611  preceding buffers are completed. Ongoing buffer transmit operations will not
16612  be affected.
16613  If the ioIntent parameter at the time of opening the driver was
16614  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16615  bytes that were actually accepted for transmission. The function will not
16616  wait until numBytes of bytes have been transmitted. If there a buffers queued
16617  for transmit, the function will not wait and will return immediately with 0
16618  bytes.
16619  Precondition:
16620  The DRV_USART_Initialize routine must have been called for the specified
16621  USART driver instance.
16622  DRV_USART_Open must have been called to obtain a valid opened device handle.
16623  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16624  the DRV_USART_Open call.
16625  Parameters:
16626  handle - A valid open-instance handle, returned from the driver's
16627  open routine
16628  buffer - Buffer containing the data to written.
16629  numbytes - size of the buffer
16630  Returns:
16631  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
16632  in case of an error.
16633  Example:
16634  <code>
16635  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16636  char myBuffer[MY_BUFFER_SIZE];
16637  int count;
16638  unsigned int total;
16639  total = 0;
16640  do
16641  {
16642  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
16643  MY_BUFFER_SIZE - total);
16644  total += count;
16645  // Do something else...
16646  } while( total < MY_BUFFER_SIZE );
16647  </code>
16648  Remarks:
16649  This function is thread safe in a RTOS application. This function is thread
16650  safe in a RTOS application. If the driver is configured for polled
16651  operation, this it will not support blocking operation in a bare metal (non-RTOS)
16652  application.
16653 */
16654 
16655 size_t
16656  DRV_USART_Write (
16657  const DRV_HANDLE handle ,
16658  void * buffer ,
16659  const size_t numbytes ) ;
16660 // *****************************************************************************
16661 /* Function:
16662  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
16663  Summary:
16664  Returns the transmitter and receiver transfer status.
16665  <p><b>Implementation:</b> Static/Dynamic</p>
16666  Description:
16667  This returns the transmitter and receiver transfer status.
16668  Precondition:
16669  The DRV_USART_Initialize routine must have been called for the specified
16670  USART driver instance.
16671  DRV_USART_Open must have been called to obtain a valid opened device handle.
16672  Parameters:
16673  handle - A valid open-instance handle, returned from the driver's
16674  open routine
16675  Returns:
16676  A DRV_USART_TRANSFER_STATUS value describing the current status
16677  of the transfer.
16678  Example:
16679  <code>
16680  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16681  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
16682  {
16683  // Data has been received that can be read
16684  }
16685  </code>
16686  Remarks:
16687  The returned status may contain a value with more than one of the bits
16688  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
16689  should perform an "AND" with the bit of interest and verify if the result is
16690  non-zero (as shown in the example) to verify the desired status bit. This
16691  function is thread safe when called in a RTOS application.
16692 */
16693 
16696  const DRV_HANDLE handle ) ;
16697 // *****************************************************************************
16698 // *****************************************************************************
16699 // Section: USART Driver Byte Model Routines
16700 // *****************************************************************************
16701 // *****************************************************************************
16702 // *****************************************************************************
16703 /* Function:
16704  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
16705  Summary:
16706  Reads a byte of data from the USART.
16707  <p><b>Implementation:</b> Static/Dynamic</p>
16708  Description:
16709  This routine reads a byte of data from the USART.
16710  Precondition:
16711  The DRV_USART_Initialize routine must have been called for the specified
16712  USART driver instance.
16713  DRV_USART_Open must have been called to obtain a valid opened device handle.
16714  The transfer status should be checked to see if the receiver is not empty
16715  before calling this function.
16716  Parameters:
16717  handle - A valid open-instance handle, returned from the driver's
16718  open routine
16719  Returns:
16720  A data byte received by the driver.
16721  Example:
16722  <code>
16723  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16724  char myBuffer[MY_BUFFER_SIZE];
16725  unsigned int numBytes;
16726  numBytes = 0;
16727  do
16728  {
16729  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
16730  {
16731  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
16732  }
16733  // Do something else...
16734  } while( numBytes < MY_BUFFER_SIZE);
16735  </code>
16736  Remarks:
16737  This function is thread safe when called in a RTOS application. Note that
16738  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16739  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16740  DRV_USART_Write functions in a application. Calling the
16741  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
16742  processing of any queued buffers.
16743 */
16744 
16745 uint8_t
16747  const DRV_HANDLE handle ) ;
16748 // *****************************************************************************
16749 /* Function:
16750  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
16751  Summary:
16752  Writes a byte of data to the USART.
16753  <p><b>Implementation:</b> Static/Dynamic</p>
16754  Description:
16755  This routine writes a byte of data to the USART.
16756  Precondition:
16757  The DRV_USART_Initialize routine must have been called for the specified
16758  USART driver instance.
16759  DRV_USART_Open must have been called to obtain a valid opened device handle.
16760  The transfer status should be checked to see if transmitter is not full
16761  before calling this function.
16762  Parameters:
16763  handle - A valid open-instance handle, returned from the driver's
16764  open routine
16765  byte - Data byte to write to the USART
16766  Returns:
16767  None.
16768  Example:
16769  <code>
16770  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16771  char myBuffer[MY_BUFFER_SIZE];
16772  unsigned int numBytes;
16773  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
16774  numBytes = 0;
16775  while( numBytes < MY_BUFFER_SIZE );
16776  {
16777  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
16778  {
16779  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
16780  }
16781  // Do something else...
16782  }
16783  </code>
16784  Remarks:
16785  This function is thread safe when called in a RTOS application. Note that
16786  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16787  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16788  DRV_USART_Write functions in a application. Calling the
16789  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
16790  processing of any queued buffers.
16791 */
16792 
16793 void
16795  const DRV_HANDLE handle ,
16796  const uint8_t byte ) ;
16797 // *****************************************************************************
16798 /* Function:
16799  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
16800  Summary:
16801  Returns the size of the receive buffer.
16802  <p><b>Implementation:</b> Static/Dynamic</p>
16803  Description:
16804  This routine returns the size of the receive buffer.
16805  Precondition:
16806  The DRV_USART_Initialize routine must have been called for the specified
16807  USART driver instance.
16808  DRV_USART_Open must have been called to obtain a valid opened device handle.
16809  Parameters:
16810  handle - A valid open-instance handle, returned from the driver's
16811  open routine
16812  Returns:
16813  Size of the driver's receive buffer, in bytes.
16814  Example:
16815  <code>
16816  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16817  const uint8_t readBuffer[5];
16818  unsigned int size, numBytes = 0;
16819  unsigned int readbufferLen = sizeof(readBuffer);
16820  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
16821  // Do something based on the receiver buffer size
16822  </code>
16823  Remarks:
16824  Does not account for client queued buffers. This function is thread safe
16825  when called in a RTOS application.
16826 */
16827 
16828 unsigned int
16830  const DRV_HANDLE handle ) ;
16831 // *****************************************************************************
16832 /* Function:
16833  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
16834  Summary:
16835  Returns the size of the transmit buffer.
16836  <p><b>Implementation:</b> Static/Dynamic</p>
16837  Description:
16838  This routine returns the size of the transmit buffer and can be used by the
16839  application to determine the number of bytes to write with the
16840  DRV_USART_WriteByte function.
16841  Precondition:
16842  The DRV_USART_Initialize routine must have been called for the specified
16843  USART driver instance.
16844  DRV_USART_Open must have been called to obtain a valid opened device handle.
16845  Parameters:
16846  handle - A valid open-instance handle, returned from the driver's
16847  open routine
16848  Returns:
16849  Size of the driver's transmit buffer, in bytes.
16850  Examples:
16851  <code>
16852  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16853  const uint8_t writeBuffer[5];
16854  unsigned int size, numBytes = 0;
16855  unsigned int writeBufferLen = sizeof(writeBuffer);
16856  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
16857  // Do something based on the transmitter buffer size
16858  </code>
16859  Remarks:
16860  Does not account for client queued buffers. This function is thread safe
16861  when used in a RTOS application.
16862 */
16863 
16864 unsigned int
16866  const DRV_HANDLE handle ) ;
16867 // *****************************************************************************
16868 /* Function:
16869  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
16870  Summary:
16871  Provides the status of the driver's receive buffer.
16872  <p><b>Implementation:</b> Static/Dynamic</p>
16873  Description:
16874  This routine indicates if the driver's receiver buffer is empty. This
16875  function can be used in conjunction with the DRV_USART_Read and
16876  DRV_USART_ReadByte functions.
16877  Precondition:
16878  The DRV_USART_Initialize routine must have been called for the specified
16879  USART driver instance.
16880  DRV_USART_Open must have been called to obtain a valid opened device handle.
16881  Parameters:
16882  handle - A valid open-instance handle, returned from the driver's
16883  open routine
16884  Returns:
16885  true - if the driver's receive buffer is empty
16886  false - if the driver's receive buffer is not empty
16887  Example:
16888  <code>
16889  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16890  char myBuffer[MY_BUFFER_SIZE];
16891  unsigned int numBytes;
16892  numBytes = 0;
16893  while( numBytes < MY_BUFFER_SIZE );
16894  {
16895  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
16896  {
16897  if( numBytes < MY_BUFFER_SIZE )
16898  {
16899  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
16900  }
16901  else
16902  {
16903  break;
16904  }
16905  }
16906  // Do something else while more data is received.
16907  }
16908  </code>
16909  Remarks:
16910  Does not account for client queued buffers. This function is safe thread
16911  safe when used in a RTOS application.
16912 */
16913 
16914 bool
16916  const DRV_HANDLE handle ) ;
16917 // *****************************************************************************
16918 /* Function:
16919  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
16920  Summary:
16921  Provides the status of the driver's transmit buffer.
16922  <p><b>Implementation:</b> Static/Dynamic</p>
16923  Description:
16924  This routine identifies if the driver's transmit buffer is full or not. This
16925  function can be used in conjunction with the DRV_USART_Write and
16926  DRV_USART_WriteByte functions.
16927  Precondition:
16928  The DRV_USART_Initialize routine must have been called for the specified
16929  USART driver instance.
16930  DRV_USART_Open must have been called to obtain a valid opened device handle.
16931  Parameters:
16932  handle - A valid open-instance handle, returned from the driver's
16933  open routine
16934  Returns:
16935  true - if the transmit buffer is full
16936  false - if the transmit buffer is not full
16937  Example:
16938  <code>
16939  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16940  unsigned int numBytes;
16941  int bytesToWrite;
16942  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
16943  int writebufferLen = strlen((char *)writeBuffer);
16944  numBytes = 0;
16945  while( numBytes < writebufferLen )
16946  {
16947  if (DRV_USART_TransmitBufferisFull())
16948  {
16949  // Do something else until there is some room in the driver's Transmit buffer.
16950  }
16951  else
16952  {
16953  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
16954  }
16955  }
16956  </code>
16957  Remarks:
16958  Does not account for client queued buffers. This function is thread safe
16959  when called in a RTOS application.
16960 */
16961 
16962 bool
16964  const DRV_HANDLE handle ) ;
16965 // *****************************************************************************
16966 /* Function:
16967  void DRV_USART_ByteTransmitCallbackSet
16968  (
16969  const SYS_MODULE_INDEX index,
16970  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
16971  )
16972  Summary:
16973  Registers a callback function for byte transmit event.
16974  Description:
16975  This function allows a transmit callback function to be registered with the
16976  driver. The callback function is invoked when a byte has been transmitted
16977  using DRV_USART_WriteByte () function.
16978  The callback function should be registered with the driver prior to any
16979  writes to the driver. The callback functionality is available only in the
16980  interrupt mode of operation. The driver clears the interrupt after invoking
16981  the callback function.
16982  Precondition:
16983  The DRV_USART_Initialize routine must have been called for the specified
16984  USART driver instance.
16985  Parameters:
16986  index - Identifier for the object instance to be opened
16987  eventHandler - Pointer to the event handler function.
16988  Returns:
16989  None.
16990  Example:
16991  <code>
16992  // myAppObj is an application specific state data object.
16993  MY_APP_OBJ myAppObj;
16994  uint8_t mybuffer[MY_BUFFER_SIZE];
16995  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
16996  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
16997  (uintptr_t)&myAppObj );
16998  // Register an event handler with driver. This is done once
16999  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17000  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17001  // Event Processing Technique. Event is received when
17002  // the byte is transmitted.
17003  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17004  {
17005  // Byte has been transmitted. Handle the event.
17006  }
17007  </code>
17008  Remarks:
17009  None
17010 */
17011 
17012 void
17014  const SYS_MODULE_INDEX index ,
17015  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17016 // *****************************************************************************
17017 /* Function:
17018  void DRV_USART_ByteReceiveCallbackSet
17019  (
17020  const SYS_MODULE_INDEX index,
17021  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17022  )
17023  Summary:
17024  Registers receive callback function for byte receive event.
17025  Description:
17026  This function allows a receive callback function to be registered with the
17027  driver. The callback function is invoked when a byte has been received. The
17028  received byte can then be read using DRV_USART_ReadByte() function.
17029  The callback function should be registered with the driver as part of the
17030  initialization. The callback functionality is available only in the
17031  interrupt mode of operation. The driver clears the interrupt after invoking
17032  the callback function.
17033  Precondition:
17034  The DRV_USART_Initialize routine must have been called for the specified
17035  USART driver instance.
17036  Parameters:
17037  index - Identifier for the object instance to be opened
17038  eventHandler - Pointer to the event handler function.
17039  Returns:
17040  None.
17041  Example:
17042  <code>
17043  // myAppObj is an application specific state data object.
17044  MY_APP_OBJ myAppObj;
17045  uint8_t mybuffer[MY_BUFFER_SIZE];
17046  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17047  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17048  (uintptr_t)&myAppObj );
17049  // Register an event handler with driver. This is done once
17050  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17051  // Event Processing Technique. Event is received when
17052  // a byte is received.
17053  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17054  {
17055  // Byte has been Received. Handle the event.
17056  // Read byte using DRV_USART_ReadByte ()
17057  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17058  // check if the receiver buffer is empty.
17059  }
17060  </code>
17061  Remarks:
17062  None
17063 */
17064 
17065 void
17067  const SYS_MODULE_INDEX index ,
17068  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17069 // *****************************************************************************
17070 /* Function:
17071  void DRV_USART_ByteErrorCallbackSet
17072  (
17073  const SYS_MODULE_INDEX index,
17074  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17075  )
17076  Summary:
17077  Registers callback to handle for byte error events.
17078  Description:
17079  This function allows a callback function to be registered with the driver
17080  to handle the error events occurring in the transmit/receive path during
17081  byte transfers.
17082  The callback function should be registered as part of the initialization.
17083  The callback functionality is available only in the interrupt mode of
17084  operation. The driver clears the interrupt after invoking the callback
17085  function.
17086  Precondition:
17087  The DRV_USART_Initialize routine must have been called for the specified
17088  USART driver instance.
17089  Parameters:
17090  index - Identifier for the object instance to be opened
17091  eventHandler - Pointer to the event handler function.
17092  Returns:
17093  None.
17094  Example:
17095  <code>
17096  // myAppObj is an application specific state data object.
17097  MY_APP_OBJ myAppObj;
17098  uint8_t mybuffer[MY_BUFFER_SIZE];
17099  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17100  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17101  (uintptr_t)&myAppObj );
17102  // Register an event handler with driver. This is done once
17103  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17104  // Event Processing Technique.
17105  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17106  {
17107  // Error has occurred. Handle the event.
17108  }
17109  </code>
17110  Remarks:
17111  None
17112 */
17113 
17114 void
17116  const SYS_MODULE_INDEX index ,
17117  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17118 // *****************************************************************************
17119 // *****************************************************************************
17120 // Section: USART Driver Setup and Status Routines
17121 // *****************************************************************************
17122 // *****************************************************************************
17123 // *****************************************************************************
17124 /* Function:
17125  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17126  Summary:
17127  This function returns the error(if any) associated with the last client
17128  request.
17129  <p><b>Implementation:</b> Static/Dynamic</p>
17130  Description:
17131  This function returns the error(if any) associated with the last client
17132  request. DRV_USART_Read and DRV_USART_Write will update the client
17133  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17134  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17135  call this function to know the error cause. The error status will be updated
17136  on every operation and should be read frequently (ideally immediately after
17137  the driver operation has completed) to know the relevant error status.
17138  Precondition:
17139  The DRV_USART_Initialize routine must have been called for the specified
17140  USART driver instance.
17141  DRV_USART_Open must have been called to obtain a valid opened device handle.
17142  Parameters:
17143  bufferhandle - Handle of the buffer of which the processed number of bytes
17144  to be obtained.
17145  Returns:
17146  A DRV_USART_ERROR type indicating last known error status.
17147  Example:
17148  <code>
17149  // myAppObj is an application specific object.
17150  MY_APP_OBJ myAppObj;
17151  uint8_t mybuffer[MY_BUFFER_SIZE];
17152  DRV_USART_BUFFER_HANDLE bufferHandle;
17153  // myUSARTHandle is the handle returned
17154  // by the DRV_USART_Open function.
17155  // Client registers an event handler with driver. This is done once.
17156  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17157  (uintptr_t)&myAppObj );
17158  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17159  myBuffer, MY_BUFFER_SIZE );
17160  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17161  {
17162  // Error handling here
17163  }
17164  // Event Processing Technique. Event is received when
17165  // the buffer is processed.
17166  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17167  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17168  {
17169  // The context handle was set to an application specific
17170  // object. It is now retrievable easily in the event handler.
17171  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17172  size_t processedBytes;
17173  switch(event)
17174  {
17175  case DRV_USART_BUFFER_EVENT_COMPLETE:
17176  // This means the data was transferred.
17177  break;
17178  case DRV_USART_BUFFER_EVENT_ERROR:
17179  // Error handling here.
17180  // We can find out how many bytes were processed in this
17181  // buffer before the error occurred. We can also find
17182  // the error cause.
17183  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17184  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17185  {
17186  // There was an receive over flow error.
17187  // Do error handling here.
17188  }
17189  break;
17190  default:
17191  break;
17192  }
17193  }
17194  </code>
17195  Remarks:
17196  It is the client's responsibility to make sure that the error status is
17197  obtained frequently. The driver will update the client error status
17198  regardless of whether this has been examined by the client. This function
17199  is thread safe when used in a RTOS application.
17200 */
17201 
17204  const DRV_HANDLE client ) ;
17205 // *****************************************************************************
17206 /* Function:
17207  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17208  Summary:
17209  This function changes the USART module baud to the specified value.
17210  <p><b>Implementation:</b> Static/Dynamic</p>
17211  Description:
17212  This function changes the USART module baud to the specified value. Any
17213  queued buffer requests will be processed at the updated baud. The USART
17214  driver operates at the baud specified in DRV_USART_Initialize function
17215  unless the DRV_USART_BaudSet function is called to change the baud.
17216  Precondition:
17217  The DRV_USART_Initialize routine must have been called for the specified
17218  USART driver instance.
17219  DRV_USART_Open must have been called to obtain a valid opened device handle.
17220  Parameters:
17221  handle - client handle returned by DRV_USART_Open function.
17222  baud - desired baud.
17223  Returns:
17224  None.
17225  Example:
17226  <code>
17227  // myUSARTHandle is the handle returned
17228  // by the DRV_USART_Open function.
17229  DRV_USART_BaudSet(myUSARTHandle, 9600);
17230  </code>
17231  Remarks:
17232  The implementation of this function, in this release of the driver, changes
17233  the baud immediately. This may interrupt on-going data transfer. It is
17234  recommended that the driver be opened exclusively if this function is to be
17235  called. This function is thread safe when used in a RTOS application.
17236 */
17237 
17240  const DRV_HANDLE client ,
17241  uint32_t baud ) ;
17242 // *****************************************************************************
17243 /* Function:
17244  void DRV_USART_LineControlSet
17245  (
17246  DRV_HANDLE client,
17247  DRV_USART_LINE_CONTROL lineControl
17248  );
17249  Summary:
17250  This function changes the USART module line control to the specified value.
17251  <p><b>Implementation:</b> Static/Dynamic</p>
17252  Description:
17253  This function changes the USART module line control parameters to the
17254  specified value. Any queued buffer requests will be processed at the
17255  updated line control parameters. The USART driver operates at the line
17256  control parameters specified in DRV_USART_Initialize function unless the
17257  DRV_USART_LineControlSet function is called to change the line control
17258  parameters.
17259  Precondition:
17260  The DRV_USART_Initialize routine must have been called for the specified
17261  USART driver instance.
17262  DRV_USART_Open must have been called to obtain a valid opened device handle.
17263  Parameters:
17264  handle - client handle returned by DRV_USART_Open function.
17265  lineControl - line control parameters.
17266  Returns:
17267  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17268  DRV_HANDLE_INVALID if the client handle is not valid.
17269  Example:
17270  <code>
17271  // myUSARTHandle is the handle returned
17272  // by the DRV_USART_Open function.
17273  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17274  </code>
17275  Remarks:
17276  The implementation of this function, in this release of the driver, changes
17277  the line control immediately. This may interrupt on-going data transfer. It
17278  is recommended that the driver be opened exclusively if this function is to
17279  be called. This function is thread safe when called in a RTOS application.
17280 */
17281 
17284  const DRV_HANDLE client ,
17285  const DRV_USART_LINE_CONTROL lineControl ) ;
17286 //DOM-IGNORE-BEGIN
17287 //DOM-IGNORE-END
17288  // #ifndef _DRV_USART_H
17289 /*******************************************************************************
17290  End of File
17291 */
17292 
17293 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17294 /* CLOSE_FILE Include File */
17295 
17296 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17297 /*******************************************************************************
17298  USART Driver Variant Mapping
17299  Company:
17300  Microchip Technology Inc.
17301  File Name:
17302  drv_usart_variant_mapping.h
17303  Summary:
17304  USART Driver Variant Mapping
17305  Description:
17306  This file provides feature and build variant mapping macros allowing the
17307  driver to easily be built with different implementation variations based
17308  on static build-time configuration selections.
17309 *******************************************************************************/
17310 //DOM-IGNORE-BEGIN
17311 /*******************************************************************************
17312 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17313 Microchip licenses to you the right to use, modify, copy and distribute
17314 Software only when embedded on a Microchip microcontroller or digital signal
17315 controller that is integrated into your product or third party product
17316 (pursuant to the sublicense terms in the accompanying license agreement).
17317 You should refer to the license agreement accompanying this Software for
17318 additional information regarding your rights and obligations.
17319 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17320 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17321 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17322 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17323 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17324 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17325 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17326 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17327 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17328 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17329 *******************************************************************************/
17330 //DOM-IGNORE-END
17331 #ifndef _DRV_USART_FEATURE_MAPPING_H
17332 #define _DRV_USART_FEATURE_MAPPING_H
17333 // *****************************************************************************
17334 // *****************************************************************************
17335 // Section: Interrrupt Variations
17336 // *****************************************************************************
17337 // *****************************************************************************
17338 /* Mapping of the interrupt mode variations
17339 */
17340  /* Driver is configured for polled mode */
17341 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17342 #define _DRV_USART_InterruptSourceEnable( source )
17343 #define _DRV_USART_InterruptSourceDisable( source ) false
17344 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17345 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17346 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17347 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17348 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17349  /* This means the driver is being built in a baremetal application.
17350  We cannot let a client open the driver in blocking mode */
17351 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17352 // *****************************************************************************
17353 // *****************************************************************************
17354 // Section: Buffer Queue support
17355 // *****************************************************************************
17356 // *****************************************************************************
17357 /* Mapping of macros for buffer queue support
17358 */
17359  /* We dont need buffer queues or byte model support */
17360 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17361 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17362 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17363 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17364 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17365 // *****************************************************************************
17366 // *****************************************************************************
17367 // Initializtion Parameter Static Overrides
17368 // *****************************************************************************
17369 // *****************************************************************************
17370  //_DRV_USART_FEATURE_MAPPING_H
17371 /*******************************************************************************
17372  End of File
17373 */
17374 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17375 /* CLOSE_FILE Include File */
17376 
17377 #include "system/clk/sys_clk.h"
17378 #include "system/int/sys_int.h"
17379 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17380 /*******************************************************************************
17381  Debug System Services Library Header
17382  Company:
17383  Microchip Technology Inc.
17384 
17385  File Name:
17386  sys_debug.h
17387  Summary:
17388  Defines the common debug definitions and interfaces used by MPLAB Harmony
17389  libraries to report errors and debug information to the user.
17390  Description:
17391  This header file defines the common debug definitions and interface macros
17392  (summary below) and prototypes used by MPLAB Harmony libraries to report
17393  errors and debug information to the user.
17394  *******************************************************************************/
17395 //DOM-IGNORE-BEGIN
17396 /*******************************************************************************
17397 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17398 Microchip licenses to you the right to use, modify, copy and distribute
17399 Software only when embedded on a Microchip microcontroller or digital signal
17400 controller that is integrated into your product or third party product
17401 (pursuant to the sublicense terms in the accompanying license agreement).
17402 You should refer to the license agreement accompanying this Software for
17403 additional information regarding your rights and obligations.
17404 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17405 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17406 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17407 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17408 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17409 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17410 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17411 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17412 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17413 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17414  *******************************************************************************/
17415 //DOM-IGNORE-END
17416 #ifndef _SYS_DEBUG_H
17417 #define _SYS_DEBUG_H
17418 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17419  /* LDRA full path */
17420 // This should be defined in system_config.h. It is added here as a build safe-guard.
17421 #define SYS_DEBUG_BUFFER_DMA_READY
17422 // *****************************************************************************
17423 // *****************************************************************************
17424 // Section: SYS DEBUG Data Types
17425 // *****************************************************************************
17426 // *****************************************************************************
17427 // *****************************************************************************
17428 /* SYS_ERROR_LEVEL enumeration
17429  Summary:
17430  System error message priority levels.
17431  Description:
17432  This enumeration defines the supported system error message priority values.
17433  Remarks:
17434  Used by debug message macros to compare individual message priority against
17435  a global system-wide error message priority level to determine if an
17436  individual message should be displayed.
17437 */
17438 
17439 typedef
17440  enum
17441  {
17442  /* Errors that have the potential to cause a system crash. */
17444  /* Errors that have the potential to cause incorrect behavior. */
17446  /* Warnings about potentially unexpected behavior or side effects. */
17448  /* Information helpful to understanding potential errors and warnings. */
17450  /* Verbose information helpful during debugging and testing. */
17452  } SYS_ERROR_LEVEL ;
17453 // DOM-IGNORE-BEGIN
17454 // *****************************************************************************
17455 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17456  SYS_DEBUG_ErrorLevelSet functions to access this value.
17457 */
17458 
17459 extern SYS_ERROR_LEVEL
17460  gblErrLvl ;
17461 // DOM-IGNORE-END
17462 // *****************************************************************************
17463 /* SYS Debug Module Index Number
17464  Summary:
17465  Debug System Service index.
17466  Description:
17467  This constant defines a symbolic name for the debug system service index.
17468  Remarks:
17469  There can only be a single debug system service instance in the system.
17470 */
17471 #define SYS_DEBUG_INDEX_0 0
17472 // *****************************************************************************
17473 /* SYS Debug Initialize structure
17474  Summary:
17475  Defines the data required to initialize the debug system service.
17476  Description:
17477  This structure defines the data required to initialize the debug system
17478  service.
17479  Remarks:
17480  None.
17481 */
17482 
17483 typedef
17484  struct
17485  {
17486  /* System module initialization */
17487  SYS_MODULE_INIT moduleInit ;
17488  /* Initial system error level setting. */
17489  SYS_ERROR_LEVEL errorLevel ;
17490  /* Console index to receive debug messages */
17491  SYS_MODULE_INDEX consoleIndex ;
17492  } SYS_DEBUG_INIT ;
17493 // *****************************************************************************
17494 // *****************************************************************************
17495 // Section: SYS DEBUG Functions
17496 // *****************************************************************************
17497 // *****************************************************************************
17498 // *****************************************************************************
17499 /* Function:
17500  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17501  const SYS_MODULE_INIT * const init )
17502  Summary:
17503  Initializes the global error level and specific module instance.
17504  Description:
17505  This function initializes the global error level. It also initializes any
17506  internal system debug module data structures.
17507  Precondition:
17508  None.
17509  Parameters:
17510  index - Index for the instance to be initialized
17511  init - Pointer to a data structure containing any data necessary
17512  to initialize the debug service. This pointer may be null
17513  if no data is required because static overrides have
17514  been provided.
17515  Returns:
17516  If successful, returns a valid handle to an object. Otherwise, it
17517  returns SYS_MODULE_OBJ_INVALID.
17518  Example:
17519  <code>
17520  SYS_MODULE_OBJ objectHandle;
17521  SYS_DEBUG_INIT debugInit =
17522  {
17523  .moduleInit = {0},
17524  .errorLevel = SYS_ERROR_DEBUG,
17525  };
17526  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
17527  if (SYS_MODULE_OBJ_INVALID == objectHandle)
17528  {
17529  // Handle error
17530  }
17531  </code>
17532  Remarks:
17533  This routine should only be called once during system initialization. If the
17534  system was already initialized it safely returns without causing any disturbance.
17535 */
17536 
17537 SYS_MODULE_OBJ
17539  const SYS_MODULE_INDEX index ,
17540  const SYS_MODULE_INIT * const init ) ;
17541 // *****************************************************************************
17542 /* Function:
17543  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
17544  const SYS_MODULE_INIT * const init )
17545  Summary:
17546  Reinitializes and refreshes the data structure for the instance of the
17547  Debug module.
17548  Description:
17549  This function reinitializes and refreshes the data structure for the instance
17550  of the Debug module using the supplied data.
17551  Precondition:
17552  The SYS_DEBUG_Initialize function should have been called before calling
17553  this function.
17554  Parameters:
17555  object - Identifies the SYS DEBUG Object returned by the Initialize
17556  interface
17557  init - Pointer to the data structure containing any data
17558  necessary to initialize the hardware
17559  Returns:
17560  None
17561  Example:
17562  <code>
17563  SYS_MODULE_OBJ objectHandle;
17564  // Populate the console initialization structure
17565  SYS_DEBUG_INIT dbgInit =
17566  {
17567  .moduleInit = {0},
17568  .errorLevel = SYS_ERROR_DEBUG,
17569  };
17570  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
17571  </code>
17572  Remarks:
17573  This operation uses the same initialization data structure as the
17574  SYS_DEBUG_Initialize operation. This function can be called multiple times
17575  to reinitialize the module.
17576 */
17577 
17578 void
17580  SYS_MODULE_OBJ object ,
17581  const SYS_MODULE_INIT * const init ) ;
17582 // *****************************************************************************
17583 /* Function:
17584  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
17585  Summary:
17586  Deinitializes the specific module instance of the Debug module.
17587  Description:
17588  This function deinitializes the specific module instance disabling its
17589  operation (and any hardware for driver modules). Resets all of the internal
17590  data structures and fields for the specified instance to the default settings.
17591  Precondition:
17592  The SYS_DEBUG_Initialize function should have been called before calling
17593  this function.
17594  Parameters:
17595  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17596  Returns:
17597  None.
17598  Example:
17599  <code>
17600  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17601  SYS_DEBUG_Deinitialize (object);
17602  </code>
17603  Remarks:
17604  Once the Initialize operation has been called, the Deinitialize
17605  operation must be called before the Initialize operation can be called
17606  again.
17607 */
17608 
17609 void
17611  SYS_MODULE_OBJ object ) ;
17612 // *****************************************************************************
17613 /* Function:
17614  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
17615  Summary:
17616  Maintains the debug module's state machine.
17617  Description:
17618  This function is used to maintain the debug module's internal state
17619  machine and implement its ISR for interrupt-driven implementations.
17620  Precondition:
17621  The SYS_DEBUG_Initialize function must have been called for the specified
17622  CONSOLE driver instance.
17623  Parameters:
17624  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17625  Returns:
17626  None.
17627  Example:
17628  <code>
17629  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17630  while (true)
17631  {
17632  SYS_DEBUG_Tasks (object);
17633  // Do other tasks
17634  }
17635  </code>
17636  Remarks:
17637  This function is normally not called directly by an application. It is
17638  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
17639  ISR.
17640 */
17641 
17642 void
17643  SYS_DEBUG_Tasks (
17644  SYS_MODULE_OBJ object ) ;
17645 // *****************************************************************************
17646 /* Function:
17647  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
17648  Summary:
17649  Returns status of the specific instance of the debug service module.
17650  Description:
17651  This function returns the status of the specific debug service module
17652  instance.
17653  Precondition:
17654  The SYS_CONSOLE_Initialize function should have been called before calling
17655  this function.
17656  Parameters:
17657  object - Debug module object handle, returned from SYS_DEBUG_Initialize
17658  Returns:
17659  * SYS_STATUS_READY - Indicates that the module is running and
17660  ready to service requests. Any value greater
17661  than SYS_STATUS_READY is also a normal
17662  running state in which the module is ready
17663  to accept new operations.
17664  * SYS_STATUS_BUSY - Indicates that the module is busy with a
17665  previous system level operation and cannot
17666  start another.
17667  * SYS_STATUS_ERROR - Indicates that the module is in an error
17668  state. Any value less than SYS_STATUS_ERROR
17669  is also an error state.
17670  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
17671  initialized or has been deinitialized.
17672  Example:
17673  <code>
17674  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
17675  SYS_STATUS debugStatus;
17676  debugStatus = SYS_DEBUG_Status (object);
17677  if (SYS_STATUS_ERROR >= debugStatus)
17678  {
17679  // Handle error
17680  }
17681  </code>
17682  Remarks:
17683  None.
17684 */
17685 
17686 SYS_STATUS
17688  SYS_MODULE_OBJ object ) ;
17689 // *****************************************************************************
17690 // *****************************************************************************
17691 // Section: SYS DEBUG Console Functions
17692 // *****************************************************************************
17693 // *****************************************************************************
17694 // *****************************************************************************
17695 /* Function:
17696  SYS_DEBUG_Message( const char* message );
17697  Summary:
17698  Prints a message to the console regardless of the system error level.
17699  Description:
17700  This function prints a message to the console regardless of the system
17701  error level. It can be used as an implementation of the SYS_MESSAGE and
17702  SYS_DEBUG_MESSAGE macros.
17703  Precondition:
17704  SYS_DEBUG_Initialize must have returned a valid object handle and the
17705  SYS_DEBUG_Tasks function must be called by the system to complete the
17706  message request.
17707  Parameters:
17708  message - Pointer to a message string to be displayed.
17709  Returns:
17710  None.
17711  Example:
17712  <code>
17713  // In system_config.h:
17714 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
17715 
17716  // In source (.c) files:
17717  SYS_MESSAGE("My Message\n\r");
17718  </code>
17719  Remarks:
17720  Do not call this function directly. Call the SYS_MESSAGE or
17721  SYS_DEBUG_MESSAGE macros instead.
17722 
17723  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
17724  the messages and message function calls from the source code. To access
17725  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
17726  override the definitions of the individual macros.
17727 */
17728 
17729 void
17731  const char * message ) ;
17732 // *****************************************************************************
17733 /* Function:
17734  SYS_DEBUG_Print( const char* format, ... )
17735  Summary:
17736  Formats and prints a message with a variable number of arguments to the
17737  console regardless of the system error level.
17738  Description:
17739  This function formats and prints a message with a variable number of
17740  arguments to the console regardless of the system error level. It can be
17741  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
17742  Precondition:
17743  SYS_DEBUG_Initialize must have returned a valid object handle and the
17744  SYS_DEBUG_Tasks function must be called by the system to complete the
17745  message request.
17746  Parameters:
17747  format - Pointer to a buffer containing the format string for
17748  the message to be displayed.
17749  ... - Zero or more optional parameters to be formated as
17750  defined by the format string.
17751  Returns:
17752  None.
17753  Example:
17754  <code>
17755  // In system_config.h
17756 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
17757 
17758  // In source code
17759  int result;
17760 
17761  result = SomeOperation();
17762  if (result > MAX_VALUE)
17763  {
17764  SYS_PRINT("Result of %d exceeds max value\r\n", result);
17765  }
17766  </code>
17767  Remarks:
17768  The format string and arguments follow the printf convention.
17769 
17770  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
17771  macros instead.
17772 
17773  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
17774  messages and message function calls. To access and utilize the messages,
17775  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
17776  individual macros.
17777 */
17778 
17779 void
17780  SYS_DEBUG_Print (
17781  const char * format ,
17782  ... ) ;
17783 // *****************************************************************************
17784 /* Function:
17785  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
17786  Summary:
17787  Sets the global system error reporting level.
17788  Description:
17789  This function sets the global system error reporting level.
17790 
17791  Precondition:
17792  SYS_DEBUG_Initialize must have returned a valid object handle.
17793  Parameters:
17794  level - The desired system error level.
17795  Returns:
17796  None.
17797  Example:
17798  <code>
17799  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
17800  </code>
17801  Remarks:
17802  None.
17803 */
17804 
17805 void
17807  SYS_ERROR_LEVEL level ) ;
17808 // *****************************************************************************
17809 /* Function:
17810  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
17811  Summary:
17812  Returns the global system Error reporting level.
17813  Description:
17814  This function returns the global System Error reporting level.
17815 
17816  Precondition:
17817  SYS_DEBUG_Initialize must have returned a valid object handle.
17818  Parameters:
17819  None.
17820  Returns:
17821  The global System Error Level.
17822  Example:
17823  <code>
17824  SYS_ERROR_LEVEL level;
17825 
17826  level = SYS_DEBUG_ErrorLevelGet();
17827  </code>
17828  Remarks:
17829  None.
17830 */
17831 
17833  SYS_DEBUG_ErrorLevelGet ( void ) ;
17834 // *****************************************************************************
17835 // *****************************************************************************
17836 // Section: SYS DEBUG Macros
17837 // *****************************************************************************
17838 // *****************************************************************************
17839 // *****************************************************************************
17840 /* Macro:
17841  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
17842  Summary:
17843  Prints a debug message if the specified level is at or below the global
17844  system error level.
17845  Description:
17846  This macro prints a debug message if the specified level is at or below the
17847  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
17848  Precondition:
17849  SYS_DEBUG_Initialize must have returned a valid object handle.
17850  Parameters:
17851  level - The current error level threshold for displaying the message.
17852  message - Pointer to a buffer containing the message to be displayed.
17853  Returns:
17854  None.
17855  Example:
17856  <code>
17857  // In system_config.h
17858 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
17859 
17860  // In library source (.c) code.
17861  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
17862  </code>
17863  Remarks:
17864  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
17865 
17866  The default SYS_DEBUG_MESSAGE macro definition removes the message and
17867  function call from the source code. To access and utilize the message,
17868  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17869  SYS_DEBUG_MESSAGE macro.
17870 */
17871 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
17872 // *****************************************************************************
17873 /* Macro:
17874  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
17875  Summary:
17876  Formats and prints a debug message if the specified level is at or below the
17877  global system error level.
17878  Description:
17879  This function formats and prints a debug message if the specified level is
17880  at or below the global system error level. It can be used to implement the
17881  SYS_DEBUG_PRINT macro.
17882  Precondition:
17883  SYS_DEBUG_Initialize must have returned a valid object handle.
17884  Parameters:
17885  level - The current error level threshold for displaying the message.
17886  format - Pointer to a buffer containing the format string for
17887  the message to be displayed.
17888  ... - Zero or more optional parameters to be formated as
17889  defined by the format string.
17890  Returns:
17891  None.
17892  Example:
17893  <code>
17894  // In system_config.h
17895 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
17896 
17897  // In source code
17898  int result;
17899 
17900  result = SomeOperation();
17901  if (result > MAX_VALUE)
17902  {
17903  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
17904  // Take appropriate action
17905  }
17906  </code>
17907  Remarks:
17908  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
17909 
17910  The default SYS_DEBUG_PRINT macro definition removes the message and
17911  function call from the source code. To access and utilize the message,
17912  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17913  SYS_DEBUG_PRINT macro.
17914 */
17915 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
17916 // DOM-IGNORE-BEGIN
17917 // *****************************************************************************
17918 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
17919  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
17920  (system_config.h) will map the macros below to the appropriate system
17921  console functions.
17922 */
17923 // DOM-IGNORE-END
17924 // *****************************************************************************
17925 /* Macro:
17926  SYS_MESSAGE( const char* message )
17927  Summary:
17928  Prints a message to the console regardless of the system error level.
17929  Description:
17930  This macro is used to print a message to the console regardless of the
17931  system error level. It can be mapped to any desired implementation.
17932  Precondition:
17933  If mapped to the _SYS_MESSAGE function, then the system debug service must
17934  be initialized and running.
17935  Parameters:
17936  message - Pointer to a buffer containing the message string to be
17937  displayed.
17938  Returns:
17939  None.
17940  Example:
17941  <code>
17942  // In system_config.h:
17943 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
17944 
17945  // In source (.c) files:
17946  SYS_MESSAGE("My Message\n\r");
17947  </code>
17948  Remarks:
17949  By default, this macro is defined as nothing, effectively removing all code
17950  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
17951  defined in a way that maps calls to it to the desired implementation (see
17952  example, above).
17953 
17954  This macro can be mapped to the system console service (along with other
17955  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
17956  configuration (system_config.h) instead of defining it individually.
17957 */
17958 #define SYS_MESSAGE( message )
17959 // *****************************************************************************
17960 /* Function:
17961  SYS_DEBUG_MESSAGE( const char* message )
17962  Summary:
17963  Prints a debug message if the system error level is defined defined at
17964  or lower than the level specified.
17965  Description:
17966  This function prints a debug message if the system error level is defined at
17967  or lower than the level specified.
17968  Precondition:
17969  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
17970  Parameters:
17971  level - The current error level threshold for displaying the message.
17972  message - Pointer to a buffer containing the message to be displayed.
17973  Returns:
17974  None.
17975  Example:
17976  <code>
17977 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
17978  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
17979  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
17980  </code>
17981  Remarks:
17982  By default, this macro is defined as nothing, effectively removing all code
17983  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
17984  must be defined in a way that maps calls to it to the desired implementation
17985  (see example, above).
17986 
17987  This macro can be mapped to the system console service (along with other
17988  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
17989  configuration (system_config.h) instead of defining it individually.
17990 */
17991 #define SYS_DEBUG_MESSAGE( level , message )
17992 // *****************************************************************************
17993 /* Function:
17994  SYS_PRINT(const char* format, ...);
17995  Summary:
17996  Formats and prints an error message with a variable number of arguments
17997  regardless of the system error level.
17998  Description:
17999  This function formats and prints an error message with a variable number of
18000  if the system error level is defined at or lower than the level specified.
18001  Precondition:
18002  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18003  Parameters:
18004  format - Pointer to a buffer containing the format string for
18005  the message to be displayed.
18006  ... - Zero or more optional parameters to be formated as
18007  defined by the format string.
18008  Returns:
18009  None.
18010  Example:
18011  <code>
18012  // In system_config.h
18013 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18014 
18015  // In source code
18016  int result;
18017 
18018  result = SomeOperation();
18019  if (result > MAX_VALUE)
18020  {
18021  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18022  // Take appropriate action
18023  }
18024  </code>
18025  Remarks:
18026  The format string and arguments follow the printf convention. This function
18027  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18028 
18029  By default, this macro is defined as nothing, effectively removing all code
18030  generated by calls to it. To process SYS_PRINT calls, this macro must be
18031  defined in a way that maps calls to it to the desired implementation (see
18032  example, above).
18033 
18034  This macro can be mapped to the system console service (along with other
18035  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18036  configuration (system_config.h) instead of defining it individually.
18037 */
18038 #define SYS_PRINT( fmt ,... )
18039 // *****************************************************************************
18040 /* Macro:
18041  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18042  Summary:
18043  Formats and prints an error message if the system error level is defined at
18044  or lower than the level specified.
18045  Description:
18046  This macro formats and prints an error message if the system error level
18047  is defined at or lower than the level specified.o
18048  Precondition:
18049  SYS_DEBUG_Initialize must have returned a valid object handle.
18050  Parameters:
18051  level - The current error level threshold for displaying the message.
18052  format - Pointer to a buffer containing the format string for
18053  the message to be displayed.
18054  ... - Zero or more optional parameters to be formated as
18055  defined by the format string.
18056  Returns:
18057  None.
18058  Example:
18059  <code>
18060  // In system_config.h
18061 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18062 
18063  // In source code
18064  int result;
18065 
18066  result = SomeOperation();
18067  if (result > MAX_VALUE)
18068  {
18069  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18070  // Take appropriate action
18071  }
18072  </code>
18073  Remarks:
18074  The format string and arguments follow the printf convention. This function
18075  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18076 
18077  By default, this macro is defined as nothing, effectively removing all code
18078  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18079  defined in a way that maps calls to it to the desired implementation (see
18080  example, above).
18081 
18082  This macro can be mapped to the system console service (along with other
18083  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18084  configuration (system_config.h) instead of defining it individually.
18085 */
18086 #define SYS_DEBUG_PRINT( level , fmt ,... )
18087 // *****************************************************************************
18088 /* Macro:
18089  SYS_DEBUG_BreakPoint( void )
18090  Summary:
18091  Inserts a software breakpoint instruction when building in Debug mode.
18092  Description:
18093  This macro inserts a software breakpoint instruction when building in Debug
18094  mode.
18095  Precondition:
18096  None.
18097  Parameters:
18098  None.
18099  Returns:
18100  None.
18101  Example:
18102  <code>
18103  if (myDebugTestFailed)
18104  {
18105  SYS_DEBUG_BreakPoint();
18106  }
18107  </code>
18108  Remarks:
18109  Compiles out if not built for debugging.
18110 */
18111 #define SYS_DEBUG_BreakPoint( )
18112 // *****************************************************************************
18113 // *****************************************************************************
18114 // Section: SYS DEBUG Deprecated Macros
18115 // *****************************************************************************
18116 // *****************************************************************************
18117 /* Do not use these macros for new development.
18118 */
18119 //DOM-IGNORE-BEGIN
18120 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18121 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18122 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18123 //DOM-IGNORE-END
18124  // _SYS_DEBUG_H
18125 /*******************************************************************************
18126  End of File
18127 */
18128 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18129 /* CLOSE_FILE Include File */
18130 
18131 // DOM-IGNORE-BEGIN
18132 // DOM-IGNORE-END
18133 // *****************************************************************************
18134 // *****************************************************************************
18135 // Section: Data Type Definitions
18136 // *****************************************************************************
18137 // *****************************************************************************
18138 /* USART FIFO+RX(8+1) size */
18139 #define _DRV_USART_RX_DEPTH 9
18140 // *****************************************************************************
18141 /* USART Static Driver Instance Object
18142  Summary:
18143  Object used to keep any data required for the static USART driver.
18144  Description:
18145  This object is used to keep track of any data that must be maintained to
18146  manage the USART static driver.
18147  Remarks:
18148  None.
18149 */
18150 
18151 typedef
18152  struct
18153  {
18154  /* Client specific error */
18155  DRV_USART_ERROR error ;
18156  } DRV_USART_OBJ ;
18157 // *****************************************************************************
18158 // *****************************************************************************
18159 // Section: Local functions.
18160 // *****************************************************************************
18161 // *****************************************************************************
18162 // DOM-IGNORE-BEGIN
18163 // DOM-IGNORE-END
18164  //#ifndef _DRV_USART_STATIC_LOCAL_H
18165 /*******************************************************************************
18166  End of File
18167 */
18168 
18169 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18170 /* CLOSE_FILE Include File */
18171 
18172 // DOM-IGNORE-BEGIN
18173 // DOM-IGNORE-END
18174 // *********************************************************************************************
18175 // *********************************************************************************************
18176 // Section: System Interface Headers for the Instance 0 of USART static driver
18177 // *********************************************************************************************
18178 // *********************************************************************************************
18179 
18180 SYS_MODULE_OBJ
18181  DRV_USART0_Initialize ( void ) ;
18182 
18183 void
18184  DRV_USART0_Deinitialize ( void ) ;
18185 
18186 SYS_STATUS
18187  DRV_USART0_Status ( void ) ;
18188 
18189 void
18190  DRV_USART0_TasksTransmit ( void ) ;
18191 
18192 void
18193  DRV_USART0_TasksReceive ( void ) ;
18194 
18195 void
18196  DRV_USART0_TasksError ( void ) ;
18197 // *********************************************************************************************
18198 // *********************************************************************************************
18199 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18200 // *********************************************************************************************
18201 // *********************************************************************************************
18202 
18203 DRV_HANDLE
18204  DRV_USART0_Open (
18205  const SYS_MODULE_INDEX index ,
18206  const DRV_IO_INTENT ioIntent ) ;
18207 
18208 void
18209  DRV_USART0_Close ( void ) ;
18210 
18212  DRV_USART0_ClientStatus ( void ) ;
18213 
18215  DRV_USART0_TransferStatus ( void ) ;
18216 
18218  DRV_USART0_ErrorGet ( void ) ;
18219 // *********************************************************************************************
18220 // *********************************************************************************************
18221 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18222 // *********************************************************************************************
18223 // *********************************************************************************************
18224 
18225 uint8_t
18226  DRV_USART0_ReadByte ( void ) ;
18227 
18228 void
18230  const uint8_t byte ) ;
18231 
18232 unsigned int
18234 
18235 unsigned int
18237 
18238 bool
18240 
18241 bool
18243 // *********************************************************************************************
18244 // *********************************************************************************************
18245 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18246 // *********************************************************************************************
18247 // *********************************************************************************************
18248 
18251  uint32_t baud ) ;
18252 
18255  DRV_USART_LINE_CONTROL lineControlMode ) ;
18256 // DOM-IGNORE-BEGIN
18257 // DOM-IGNORE-END
18258  // #ifndef _DRV_USART_STATIC_H
18259 /*******************************************************************************
18260  End of File
18261 */
18262 
18263 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18264 /* CLOSE_FILE Include File */
18265 
18266 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18267 /*******************************************************************************
18268  Ports System Service Interface Definition
18269  Company:
18270  Microchip Technology Inc.
18271  File Name:
18272  sys_ports.h
18273  Summary:
18274  Ports System Service interface definitions
18275  Description:
18276  This file contains the interface definition for the Ports system
18277  service. It provides a way to interact with the Ports subsystem to
18278  manage the timing requests supported by the system
18279 *******************************************************************************/
18280 //DOM-IGNORE-BEGIN
18281 /*******************************************************************************
18282 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18283 Microchip licenses to you the right to use, modify, copy and distribute
18284 Software only when embedded on a Microchip microcontroller or digital signal
18285 controller that is integrated into your product or third party product
18286 (pursuant to the sublicense terms in the accompanying license agreement).
18287 You should refer to the license agreement accompanying this Software for
18288 additional information regarding your rights and obligations.
18289 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18290 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18291 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18292 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18293 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18294 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18295 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18296 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18297 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18298 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18299 *******************************************************************************/
18300 //DOM-IGNORE-END
18301 #ifndef _SYS_PORTS_H
18302 #define _SYS_PORTS_H
18303 // *****************************************************************************
18304 // *****************************************************************************
18305 // Section: Included Files
18306 // *****************************************************************************
18307 // *****************************************************************************
18308 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18309 /*******************************************************************************
18310  PORTS System Service Library Interface Definition
18311  Company:
18312  Microchip Technology Inc.
18313  File Name:
18314  sys_ports_definitions.h
18315  Summary:
18316  PORTS System Service data type definitions header.
18317  Description:
18318  This file contains data type definitions header.
18319 *******************************************************************************/
18320 //DOM-IGNORE-BEGIN
18321 /*******************************************************************************
18322 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18323 Microchip licenses to you the right to use, modify, copy and distribute
18324 Software only when embedded on a Microchip microcontroller or digital signal
18325 controller that is integrated into your product or third party product
18326 (pursuant to the sublicense terms in the accompanying license agreement).
18327 You should refer to the license agreement accompanying this Software for
18328 additional information regarding your rights and obligations.
18329 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18330 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18331 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18332 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18333 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18334 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18335 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18336 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18337 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18338 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18339 *******************************************************************************/
18340 //DOM-IGNORE-END
18341 #ifndef _SYS_PORTS_DEFINITIONS_H
18342 #define _SYS_PORTS_DEFINITIONS_H
18343 // *****************************************************************************
18344 // *****************************************************************************
18345 // Section: File includes
18346 // *****************************************************************************
18347 // *****************************************************************************
18348 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18349 #include "system/common/sys_common.h"
18350 #include "system/common/sys_module.h"
18351 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18352 /*******************************************************************************
18353  Ports Peripheral Library Interface Header
18354  Company:
18355  Microchip Technology Inc.
18356  File Name:
18357  plib_ports.h
18358  Summary:
18359  Ports Peripheral Library Interface header for Ports function definitions.
18360  Description:
18361  This header file contains the function prototypes and definitions of
18362  the data types and constants that make up the interface to the Ports
18363  Peripheral Library for all families of Microchip microcontrollers. The
18364  definitions in this file are common to the Ports peripheral.
18365 *******************************************************************************/
18366 // DOM-IGNORE-BEGIN
18367 /*******************************************************************************
18368 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18369 Microchip licenses to you the right to use, modify, copy and distribute
18370 Software only when embedded on a Microchip microcontroller or digital signal
18371 controller that is integrated into your product or third party product
18372 (pursuant to the sublicense terms in the accompanying license agreement).
18373 You should refer to the license agreement accompanying this Software for
18374 additional information regarding your rights and obligations.
18375 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18376 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18377 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18378 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18379 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18380 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18381 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18382 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18383 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18384 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18385 *******************************************************************************/
18386 // DOM-IGNORE-END
18387 #ifndef _PLIB_PORTS_H
18388 #define _PLIB_PORTS_H
18389 #include <stdint.h>
18390 #include <stddef.h>
18391 // DOM-IGNORE-BEGIN
18392 // DOM-IGNORE-END
18393 // *****************************************************************************
18394 // *****************************************************************************
18395 // Section: Constants & Data Types
18396 // *****************************************************************************
18397 // *****************************************************************************
18398 // *****************************************************************************
18399 /* Ports data mask definition
18400  Summary:
18401  Data type defining the Ports data mask
18402  Description:
18403  This data type defines the Ports data mask
18404  Remarks:
18405  None.
18406 */
18407 
18408 typedef
18409 uint16_t
18411 // *****************************************************************************
18412 /* Ports data type definition
18413  Summary:
18414  Data type defining the Ports data type.
18415  Description:
18416  This data type defines the Ports data type.
18417  Remarks:
18418  None.
18419 */
18420 
18421 typedef
18422 uint32_t
18424 // *****************************************************************************
18425 // *****************************************************************************
18426 // Section: Included Files (continued at end of file)
18427 // *****************************************************************************
18428 // *****************************************************************************
18429 /* This section lists the other files that are included in this file. However,
18430  please see the end of the file for additional implementation header files
18431  that are also included.
18432 */
18433 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18434 //DOM-IGNORE-BEGIN
18435 /*******************************************************************************
18436 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18437 Microchip licenses to you the right to use, modify, copy and distribute
18438 Software only when embedded on a Microchip microcontroller or digital signal
18439 controller that is integrated into your product or third party product
18440 (pursuant to the sublicense terms in the accompanying license agreement).
18441 You should refer to the license agreement accompanying this Software for
18442 additional information regarding your rights and obligations.
18443 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18444 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18445 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18446 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18447 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18448 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18449 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18450 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18451 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18452 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18453  *******************************************************************************/
18454 //DOM-IGNORE-END
18455 #ifndef _PLIB_PORTS_PROCESSOR_H
18456 #define _PLIB_PORTS_PROCESSOR_H
18457 #error "Can't find header"
18458 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18459 /* CLOSE_FILE Include File */
18460 
18461 // *****************************************************************************
18462 // *****************************************************************************
18463 // Section: Ports Peripheral Library Interface Routines
18464 // *****************************************************************************
18465 // *****************************************************************************
18466 // *****************************************************************************
18467 /* Function:
18468  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18469  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18470  PORTS_REMAP_INPUT_PIN remapInputPin );
18471  Summary:
18472  Input function remapping.
18473  Description:
18474  This function controls the Input function remapping. It allows user to map
18475  any of the input functionality on any of the remappable input pin.
18476  This function does not perform atomic register access.
18477  Precondition:
18478  IOLOCK bit of configuration register should be clear to allow any remapping.
18479  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18480  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18481  find more information.
18482  Parameters:
18483  index - Identifier for the device instance to be configured
18484  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18485  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18486  Returns:
18487  None.
18488  Example:
18489  <code>
18490 
18491  // System Unlock
18492  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18493  // Unlock PPS registers
18494  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18495  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18496  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18497  </code>
18498  Remarks:
18499  This feature may not be available on all devices. Please refer to the
18500  specific device data sheet to determine availability or use
18501  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18502  this feature is available.
18503 */
18504 
18505 void
18507  PORTS_MODULE_ID index ,
18508  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18509  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18510 // *****************************************************************************
18511 /* Function:
18512  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18513  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18514  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18515  Summary:
18516  Output function remapping.
18517  Description:
18518  This function controls the Output function remapping. it allows user to map
18519  any of the output functionality on any of the remappable output pin.
18520  This function does not perform atomic register access.
18521  Precondition:
18522  IOLOCK bit of configuration register should be clear to allow any remapping.
18523  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18524  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18525  find more information.
18526  Parameters:
18527  index - Identifier for the device instance to be configured
18528  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
18529  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
18530  Returns:
18531  None.
18532  Example:
18533  <code>
18534 
18535  // System Unlock
18536  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18537  // Unlock PPS registers
18538  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18539  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
18540  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
18541 
18542  </code>
18543  Remarks:
18544  This feature may not be available on all devices. Please refer to the
18545  specific device data sheet to determine availability or use
18546  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18547  this feature is available.
18548 */
18549 
18550 void
18552  PORTS_MODULE_ID index ,
18553  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
18554  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
18555 // *****************************************************************************
18556 /* Function:
18557  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
18558  PORTS_ANALOG_PIN pin,
18559  PORTS_PIN_MODE mode );
18560  Summary:
18561  Enables the selected pin as analog or digital.
18562  Description:
18563  This function enables the selected pin as analog or digital.
18564  This function does not perform atomic register access.
18565  Precondition:
18566  None.
18567  Parameters:
18568  index - Identifier for the device instance to be configured
18569  pin - Possible values of PORTS_ANALOG_PIN
18570  mode - Possible values of PORTS_PIN_MODE
18571  Returns:
18572  None.
18573  Example:
18574  <code>
18575 
18576  // Make AN0 pin as Analog
18577  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
18578 
18579  </code>
18580  Remarks:
18581  This feature may not be available on all devices. Please refer to the
18582  specific device data sheet to determine availability or use
18583  PLIB_PORTS_ExistsPinMode in your application to determine whether
18584  this feature is available.
18585 */
18586 
18587 void
18589  PORTS_MODULE_ID index ,
18590  PORTS_ANALOG_PIN pin ,
18591  PORTS_PIN_MODE mode ) ;
18592 // *****************************************************************************
18593 /* Function:
18594  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
18595  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
18596  PORTS_PIN_MODE mode );
18597  Summary:
18598  Enables the selected port pin as analog or digital.
18599  Description:
18600  This function enables the selected port pin as analog or digital.
18601  This function does not perform atomic register access.
18602  Precondition:
18603  None.
18604  Parameters:
18605  index - Identifier for the device instance to be configured
18606  channel - Port pin channel
18607  bitPos - Position in the PORT pins
18608  mode - Possible values of PORTS_PIN_MODE
18609  Returns:
18610  None.
18611  Example:
18612  <code>
18613 
18614  // Make RC5 pin Analog
18615  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
18616  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
18617 
18618  </code>
18619  Remarks:
18620  This function is only available in devices with PPS. For Non-PPS devices, use the
18621  PLIB_PORTS_PinModeSelect function.
18622 
18623  This feature may not be available on all devices. Please refer to the
18624  specific device data sheet to determine availability or use
18625  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
18626  this feature is available.
18627 */
18628 
18629 void
18631  PORTS_MODULE_ID index ,
18632  PORTS_CHANNEL channel ,
18633  PORTS_BIT_POS bitPos ,
18634  PORTS_PIN_MODE mode ) ;
18635 // *****************************************************************************
18636 /* Function:
18637  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
18638  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18639  Summary:
18640  Enables the pull-down for selected Change Notice pins.
18641  Description:
18642  This function enables the pull-down for selected Change Notice pins.
18643  This function does not perform atomic register access.
18644  Precondition:
18645  None.
18646  Parameters:
18647  index - Identifier for the device instance to be configured
18648  channel - Port pin channel
18649  bitPos - Position in the PORT pins
18650  Returns:
18651  None.
18652  Example:
18653  <code>
18654 
18655  // Enable pull-down for RC5 pin
18656  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18657  PORTS_BIT_POS_5);
18658 
18659  </code>
18660  Remarks:
18661  This feature may not be available on all devices. Please refer to the
18662  specific device data sheet to determine availability or use
18663  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18664  determine whether this feature is available.
18665 */
18666 
18667 void
18669  PORTS_MODULE_ID index ,
18670  PORTS_CHANNEL channel ,
18671  PORTS_BIT_POS bitPos ) ;
18672 // *****************************************************************************
18673 /* Function:
18674  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
18675  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18676  Summary:
18677  Disables the pull-down for selected Change Notice pins.
18678  Description:
18679  This function disables the pull-down for selected Change Notice pins.
18680  This function does not perform atomic register access.
18681  Precondition:
18682  None.
18683  Parameters:
18684  index - Identifier for the device instance to be configured
18685  channel - Port pin channel
18686  bitPos - Position in the PORT pins
18687  Returns:
18688  None.
18689  Example:
18690  <code>
18691 
18692  // Disable pull-down for RC5 pin
18693  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18694  PORTS_BIT_POS_5);
18695  </code>
18696  Remarks:
18697  This feature may not be available on all devices. Please refer to the
18698  specific device data sheet to determine availability or use
18699  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18700  determine whether this feature is available.
18701 */
18702 
18703 void
18705  PORTS_MODULE_ID index ,
18706  PORTS_CHANNEL channel ,
18707  PORTS_BIT_POS bitPos ) ;
18708 // *****************************************************************************
18709 /* Function:
18710  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
18711  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18712  Summary:
18713  Enables the pull-up for selected Change Notice pins.
18714  Description:
18715  This function enables the pull-up for selected Change Notice pins.
18716  This function does not perform atomic register access.
18717  Precondition:
18718  None.
18719  Parameters:
18720  index - Identifier for the device instance to be configured
18721  channel - Port pin channel
18722  bitPos - Position in the PORT pins
18723  Returns:
18724  None.
18725  Example:
18726  <code>
18727 
18728  // Enable pull-up for RC5 pin
18729  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18730  PORTS_BIT_POS_5);
18731  </code>
18732  Remarks:
18733  This function is only available in devices with PPS. For Non-PPS devices, use the
18734  PLIB_PORTS_ChangeNoticePullUpEnable function.
18735 
18736  This feature may not be available on all devices. Please refer to the
18737  specific device data sheet to determine availability or use
18738  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18739  determine whether this feature is available.
18740 */
18741 
18742 void
18744  PORTS_MODULE_ID index ,
18745  PORTS_CHANNEL channel ,
18746  PORTS_BIT_POS bitPos ) ;
18747 // *****************************************************************************
18748 /* Function:
18749  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
18750  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
18751  Summary:
18752  Disables weak pull-up for the selected pin.
18753  Description:
18754  This function disables weak pull-up for the selected port pin.
18755  This function does not perform atomic register access.
18756  Precondition:
18757  None.
18758  Parameters:
18759  index - Identifier for the device instance to be configured
18760  channel - Port pin channel
18761  bitPos - Position in the PORT pins
18762  Returns:
18763  None.
18764  Example:
18765  <code>
18766 
18767  // Disable pull-up for RC5 pin
18768  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18769  PORTS_BIT_POS_5);
18770 
18771  </code>
18772  Remarks:
18773  This function is only available in devices with PPS. For Non-PPS devices, use the
18774  PLIB_PORTS_ChangeNoticePullUpDisable function.
18775 
18776  Pull-ups on change notification pins should always be disabled when the
18777  port pin is configured as a digital output.
18778 
18779  This feature may not be available on all devices. Please refer to the
18780  specific device data sheet to determine availability or use
18781  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18782  determine whether this feature is available.
18783 */
18784 
18785 void
18787  PORTS_MODULE_ID index ,
18788  PORTS_CHANNEL channel ,
18789  PORTS_BIT_POS bitPos ) ;
18790 // *****************************************************************************
18791 /* Function:
18792  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
18793  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18794  Summary:
18795  Enables CN interrupt for the selected pin.
18796  Description:
18797  This function enables Change Notice interrupt for the selected port pin.
18798  This function does not perform atomic register access.
18799 
18800  Precondition:
18801  None.
18802  Parameters:
18803  index - Identifier for the device instance to be configured
18804  channel - Port pin channel
18805  bitPos - Position in the PORT pins
18806  Returns:
18807  None.
18808  Example:
18809  <code>
18810 
18811  // Enable CN interrupt for RC5 pin
18812  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18813  PORTS_BIT_POS_5);
18814 
18815  </code>
18816  Remarks:
18817  This function is only available in devices with PPS. For Non-PPS devices, use the
18818  PLIB_PORTS_PinChangeNoticeEnable function.
18819 
18820  This feature may not be available on all devices. Please refer to the
18821  specific device data sheet to determine availability or use
18822  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18823  determine whether this feature is available.
18824 */
18825 
18826 void
18828  PORTS_MODULE_ID index ,
18829  PORTS_CHANNEL channel ,
18830  PORTS_BIT_POS bitPos ) ;
18831 // *****************************************************************************
18832 /* Function:
18833  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
18834  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18835  Summary:
18836  Disables CN interrupt for the selected pin.
18837  Description:
18838  This function disables Change Notice interrupt for the selected port pin.
18839  This function does not perform atomic register access.
18840  Precondition:
18841  None.
18842  Parameters:
18843  index - Identifier for the device instance to be configured
18844  channel - Port pin channel
18845  bitPos - Position in the PORT pins
18846  Returns:
18847  None.
18848  Example:
18849  <code>
18850 
18851  // Disable CN interrupt for RC5 pin
18852  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18853  PORTS_BIT_POS_5);
18854 
18855  </code>
18856  Remarks:
18857  This function is only available in devices with PPS. For Non-PPS devices, use the
18858  PLIB_PORTS_PinChangeNoticeDisable function.
18859 
18860  This feature may not be available on all devices. Please refer to the
18861  specific device data sheet to determine availability or use
18862  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18863  determine whether this feature is available.
18864 */
18865 
18866 void
18868  PORTS_MODULE_ID index ,
18869  PORTS_CHANNEL channel ,
18870  PORTS_BIT_POS bitPos ) ;
18871 // *****************************************************************************
18872 /* Function:
18873  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
18874  PORTS_CHANNEL channel );
18875  Summary:
18876  Enables the change notification for selected port.
18877  Description:
18878  This function enables the change notification for selected port.
18879  This function does not perform atomic register access.
18880  Precondition:
18881  None.
18882  Parameters:
18883  index - Identifier for the device instance to be configured
18884  channel - Port pin channel
18885  Returns:
18886  None.
18887  Example:
18888  <code>
18889  // Enable Change notification for Port C
18890  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
18891 
18892  </code>
18893  Remarks:
18894  This function is only available in devices with PPS. For Non-PPS devices, use the
18895  PLIB_PORTS_ChangeNoticeEnable function.
18896 
18897  This feature may not be available on all devices. Please refer to the
18898  specific device data sheet to determine availability or use
18899  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18900  whether this feature is available.
18901 */
18902 
18903 void
18905  PORTS_MODULE_ID index ,
18906  PORTS_CHANNEL channel ) ;
18907 // *****************************************************************************
18908 /* Function:
18909  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
18910  PORTS_CHANNEL channel );
18911  Summary:
18912  Disables the change notification for selected port.
18913  Description:
18914  This function disables the change notification for selected port.
18915  This function does not perform atomic register access.
18916  Precondition:
18917  None.
18918  Parameters:
18919  index - Identifier for the device instance to be configured
18920  channel - Port pin channel
18921  Returns:
18922  None.
18923  Example:
18924  <code>
18925  // Disable Change notification for Port C
18926  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
18927 
18928  </code>
18929  Remarks:
18930  This function is only available in devices with PPS. For Non-PPS devices, use the
18931  PLIB_PORTS_ChangeNoticeDisable function.
18932 
18933  This feature may not be available on all devices. Please refer to the
18934  specific device data sheet to determine availability or use
18935  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18936  whether this feature is available.
18937 */
18938 
18939 void
18941  PORTS_MODULE_ID index ,
18942  PORTS_CHANNEL channel ) ;
18943 // *****************************************************************************
18944 /* Function:
18945  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
18946  PORTS_CHANNEL channel );
18947  Summary:
18948  Allows CN to be working in Idle mode for selected channel.
18949  Description:
18950  This function makes sure that change notification feature keeps working in
18951  Idle mode for the selected channel.
18952  This function does not perform atomic register access.
18953  Precondition:
18954  None.
18955  Parameters:
18956  index - Identifier for the device instance to be configured
18957  channel - Port pin channel
18958  Returns:
18959  None.
18960  Example:
18961  <code>
18962 
18963  // Change notification continues working in Idle mode for Port C
18964  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
18965 
18966  </code>
18967  Remarks:
18968  This function is only available in devices with PPS. For Non-PPS devices, use the
18969  PLIB_PORTS_ChangeNoticeInIdleEnable function.
18970 
18971  This feature may not be available on all devices. Please refer to the
18972  specific device data sheet to determine availability or use
18973  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
18974  whether this feature is available.
18975 */
18976 
18977 void
18979  PORTS_MODULE_ID index ,
18980  PORTS_CHANNEL channel ) ;
18981 // *****************************************************************************
18982 /* Function:
18983  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
18984  PORTS_CHANNEL channel );
18985  Summary:
18986  Change Notification halts in Idle mode for selected channel.
18987  Description:
18988  This function makes sure that change notification feature halts in
18989  Idle mode for the selected channel.
18990  This function does not perform atomic register access.
18991  Precondition:
18992  None.
18993  Parameters:
18994  index - Identifier for the device instance to be configured
18995  channel - Port pin channel
18996  Returns:
18997  None.
18998  Example:
18999  <code>
19000 
19001  // Change notification halts in Idle mode for Port C
19002  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19003 
19004  </code>
19005  Remarks:
19006  This function is only available in devices with PPS. For Non-PPS devices, use the
19007  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19008 
19009  This feature may not be available on all devices. Please refer to the
19010  specific device data sheet to determine availability or use
19011  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19012  whether this feature is available.
19013 */
19014 
19015 void
19017  PORTS_MODULE_ID index ,
19018  PORTS_CHANNEL channel ) ;
19019 // *****************************************************************************
19020 /* Function:
19021  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19022  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19023  Summary:
19024  checks the status of change on the pin
19025  Description:
19026  This function checks if the change has occurred on the given pin or not.
19027  This function does not perform atomic register access.
19028  Precondition:
19029  None.
19030  Parameters:
19031  index - Identifier for the device instance to be configured
19032  channel - Port pin channel
19033  bitPos - Position in the PORT pins
19034  Returns:
19035  None.
19036  Example:
19037  <code>
19038 
19039  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19040  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19041  {
19042  //do something
19043  }
19044 
19045  </code>
19046  Remarks:
19047  This feature may not be available on all devices. Please refer to the
19048  specific device data sheet to determine availability or use
19049  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19050  whether this feature is available.
19051 */
19052 
19053 bool
19055  PORTS_MODULE_ID index ,
19056  PORTS_CHANNEL channel ,
19057  PORTS_BIT_POS bitPos ) ;
19058 // *****************************************************************************
19059 /* Function:
19060  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19061  PORTS_BIT_POS bitPos )
19062  Summary:
19063  Reads/Gets data from the selected digital pin.
19064  Description:
19065  This function reads/gets data from the selected digital PORT i/o pin.
19066  This function should be used to read the live data at the pin.
19067  This function does not perform atomic register access.
19068 
19069  Precondition:
19070  None.
19071  Parameters:
19072  index - Identifier for the device instance to be configured
19073  channel - Identifier for the Ports channel A, B, C, etc.
19074  bitPos - Possible values of PORTS_BIT_POS
19075  Returns:
19076  Port pin read data.
19077  Example:
19078  <code>
19079  // read port pin RC4
19080  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19081  PORTS_BIT_POS_4);
19082  </code>
19083  Remarks:
19084  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19085 
19086  This feature may not be available on all devices. Please refer to the
19087  specific device data sheet to determine availability or use
19088  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19089  this feature is available.
19090 */
19091 
19092 bool
19094  PORTS_MODULE_ID index ,
19095  PORTS_CHANNEL channel ,
19096  PORTS_BIT_POS bitPos ) ;
19097 // *****************************************************************************
19098 /* Function:
19099  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19100  PORTS_BIT_POS bitPos )
19101  Summary:
19102  Reads/Gets data from the selected latch.
19103  Description:
19104  This function reads/gets data from the selected PORTx Data Latch, not from
19105  the port I/O pins.
19106  This function does not perform atomic register access.
19107 
19108  Precondition:
19109  None.
19110  Parameters:
19111  index - Identifier for the device instance to be configured
19112  channel - Identifier for the Ports channel A, B, C, etc.
19113  bitPos - Possible values of PORTS_BIT_POS
19114  Returns:
19115  Latch read data.
19116  Example:
19117  <code>
19118  // read latch RC4
19119  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19120  PORTS_BIT_POS_4);
19121  </code>
19122  Remarks:
19123  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19124  should be used.
19125 
19126  This feature may not be available on all devices. Please refer to the
19127  specific device data sheet to determine availability or use
19128  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19129  this feature is available.
19130 */
19131 
19132 bool
19134  PORTS_MODULE_ID index ,
19135  PORTS_CHANNEL channel ,
19136  PORTS_BIT_POS bitPos ) ;
19137 // *****************************************************************************
19138 /* Function:
19139  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19140  PORTS_BIT_POS bitPos,
19141  bool value )
19142  Summary:
19143  Writes the selected digital pin/latch.
19144  Description:
19145  This function writes to the selected digital pin/latch.
19146  This function does not perform atomic register access.
19147  Precondition:
19148  None.
19149  Parameters:
19150  index - Identifier for the device instance to be configured
19151  channel - Identifier for the Ports channel A, B, C, etc.
19152  bitPos - Possible values of PORTS_BIT_POS
19153  value - Value to be written to the specific pin/latch
19154  true - sets the bit, false - clears the bit
19155  Returns:
19156  None.
19157  Example:
19158  <code>
19159 
19160  // write 'one' in port RC4
19161  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19162 
19163  </code>
19164  Remarks:
19165  This feature may not be available on all devices. Please refer to the
19166  specific device data sheet to determine availability or use
19167  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19168  this feature is available.
19169 */
19170 
19171 void
19173  PORTS_MODULE_ID index ,
19174  PORTS_CHANNEL channel ,
19175  PORTS_BIT_POS bitPos ,
19176  bool value ) ;
19177 // *****************************************************************************
19178 /* Function:
19179  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19180  PORTS_BIT_POS bitPos )
19181  Summary:
19182  Sets the selected digital pin/latch.
19183  Description:
19184  This function sets the selected digital pin/latch.
19185  This function does not perform atomic register access.
19186  Precondition:
19187  None.
19188  Parameters:
19189  index - Identifier for the device instance to be configured
19190  channel - Identifier for the Ports channel A, B, C, etc.
19191  bitPos - Possible values of PORTS_BIT_POS
19192  Returns:
19193  None.
19194  Example:
19195  <code>
19196 
19197  // Sets port pin RC4
19198  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19199 
19200  </code>
19201  Remarks:
19202  This feature may not be available on all devices. Please refer to the
19203  specific device data sheet to determine availability or use
19204  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19205  this feature is available.
19206 */
19207 
19208 void
19210  PORTS_MODULE_ID index ,
19211  PORTS_CHANNEL channel ,
19212  PORTS_BIT_POS bitPos ) ;
19213 // *****************************************************************************
19214 /* Function:
19215  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19216  PORTS_BIT_POS bitPos )
19217  Summary:
19218  Clears the selected digital pin/latch.
19219  Description:
19220  This function clears the selected digital pin/latch.
19221  This function does not perform atomic register access.
19222  Precondition:
19223  None.
19224  Parameters:
19225  index - Identifier for the device instance to be configured
19226  channel - Identifier for the Ports channel A, B, C, etc.
19227  bitPos - Possible values of PORTS_BIT_POS
19228  Returns:
19229  None.
19230  Example:
19231  <code>
19232 
19233  // Clears port pin RC4
19234  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19235 
19236  </code>
19237  Remarks:
19238  This feature may not be available on all devices. Please refer to the
19239  specific device data sheet to determine availability or use
19240  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19241  this feature is available.
19242 */
19243 
19244 void
19246  PORTS_MODULE_ID index ,
19247  PORTS_CHANNEL channel ,
19248  PORTS_BIT_POS bitPos ) ;
19249 // *****************************************************************************
19250 /* Function:
19251  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19252  PORTS_BIT_POS bitPos )
19253  Summary:
19254  Toggles the selected digital pin/latch.
19255  Description:
19256  This function toggles the selected digital pin/latch.
19257  This function does not perform atomic register access.
19258  Precondition:
19259  None.
19260  Parameters:
19261  index - Identifier for the device instance to be configured
19262  channel - Identifier for the Ports channel A, B, C, etc.
19263  bitPos - Possible values of PORTS_BIT_POS
19264  Returns:
19265  None.
19266  Example:
19267  <code>
19268 
19269  // Toggles port pin RC4
19270  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19271 
19272  </code>
19273  Remarks:
19274  This feature may not be available on all devices. Please refer to the
19275  specific device data sheet to determine availability or use
19276  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19277  this feature is available.
19278 */
19279 
19280 void
19282  PORTS_MODULE_ID index ,
19283  PORTS_CHANNEL channel ,
19284  PORTS_BIT_POS bitPos ) ;
19285 // *****************************************************************************
19286 /* Function:
19287  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19288  PORTS_BIT_POS bitPos )
19289  Summary:
19290  Makes the selected pin direction input
19291  Description:
19292  This function makes the selected pin direction as input
19293  This function does not perform atomic register access.
19294  Precondition:
19295  None.
19296  Parameters:
19297  index - Identifier for the device instance to be configured
19298  channel - Identifier for the Ports channel A, B, C, etc.
19299  bitPos - Possible values of PORTS_BIT_POS direction that has to
19300  be made input
19301  Returns:
19302  None.
19303  Example:
19304  <code>
19305 
19306  // make pin RC4 as input
19307  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19308 
19309  </code>
19310  Remarks:
19311  This feature may not be available on all devices. Please refer to the
19312  specific device data sheet to determine availability or use
19313  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19314  this feature is available.
19315 */
19316 
19317 void
19319  PORTS_MODULE_ID index ,
19320  PORTS_CHANNEL channel ,
19321  PORTS_BIT_POS bitPos ) ;
19322 // *****************************************************************************
19323 /* Function:
19324  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19325  PORTS_BIT_POS bitPos )
19326  Summary:
19327  Makes the selected pin direction output
19328  Description:
19329  This function makes the selected pin direction as output
19330  This function does not perform atomic register access.
19331  Precondition:
19332  None.
19333  Parameters:
19334  index - Identifier for the device instance to be configured
19335  channel - Identifier for the Ports channel A, B, C, etc.
19336  bitPos - Possible values of PORTS_BIT_POS direction that has to
19337  be made output
19338  Returns:
19339  None.
19340  Example:
19341  <code>
19342 
19343  // make pin RC4 as output
19344  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19345 
19346  </code>
19347  Remarks:
19348  This feature may not be available on all devices. Please refer to the
19349  specific device data sheet to determine availability or use
19350  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19351  this feature is available.
19352 */
19353 
19354 void
19356  PORTS_MODULE_ID index ,
19357  PORTS_CHANNEL channel ,
19358  PORTS_BIT_POS bitPos ) ;
19359 // *****************************************************************************
19360 /* Function:
19361  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19362  PORTS_BIT_POS bitPos )
19363  Summary:
19364  Enables the open drain functionality for the selected pin.
19365  Description:
19366  This function enables the open drain functionality for the selected pin.
19367  This function does not perform atomic register access.
19368  Precondition:
19369  None.
19370  Parameters:
19371  index - Identifier for the device instance to be configured
19372  channel - Identifier for the Ports channel A, B, C, etc.
19373  bitPos - Possible values of PORTS_BIT_POS
19374  Returns:
19375  None.
19376  Example:
19377  <code>
19378 
19379  // Enable open drain for pin RC4
19380  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19381 
19382  </code>
19383  Remarks:
19384  This feature may not be available on all devices. Please refer to the
19385  specific device data sheet to determine availability or use
19386  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19387  this feature is available.
19388 */
19389 
19390 void
19392  PORTS_MODULE_ID index ,
19393  PORTS_CHANNEL channel ,
19394  PORTS_BIT_POS bitPos ) ;
19395 // *****************************************************************************
19396 /* Function:
19397  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19398  PORTS_BIT_POS bitPos )
19399  Summary:
19400  Disables the open drain functionality for the selected pin.
19401  Description:
19402  This function disables the open drain functionality for the selected pin.
19403  This function does not perform atomic register access.
19404  Precondition:
19405  None.
19406  Parameters:
19407  index - Identifier for the device instance to be configured
19408  channel - Identifier for the Ports channel A, B, C, etc.
19409  bitPos - One of the possible values of PORTS_BIT_POS.
19410  Returns:
19411  None.
19412  Example:
19413  <code>
19414 
19415  // Disable open drain for pin RC4
19416  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19417 
19418  </code>
19419  Remarks:
19420  This feature may not be available on all devices. Please refer to the
19421  specific device data sheet to determine availability or use
19422  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19423  this feature is available.
19424 */
19425 
19426 void
19428  PORTS_MODULE_ID index ,
19429  PORTS_CHANNEL channel ,
19430  PORTS_BIT_POS bitPos ) ;
19431 // *****************************************************************************
19432 /* Function:
19433  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19434  (
19435  PORTS_MODULE_ID index,
19436  PORTS_CHANNEL channel
19437  )
19438  Summary:
19439  Reads and returns data from the selected Latch.
19440  Description:
19441  This function reads and returns the data from the selected Latch.
19442  This function does not perform atomic register access.
19443 
19444  Precondition:
19445  None.
19446  Parameters:
19447  index - Identifier for the device instance to be configured
19448  channel - Identifier for the Ports channel A, B, C, etc.
19449  Returns:
19450  Latch read data.
19451  Example:
19452  <code>
19453  // Read latch C
19454  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19455 
19456  </code>
19457  Remarks:
19458  For reading the Live data, PLIB_PORTS_Read function should be used.
19459 
19460  This feature may not be available on all devices. Please refer to the
19461  specific device data sheet to determine availability or use
19462  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19463  this feature is available.
19464 */
19465 
19468  PORTS_MODULE_ID index ,
19469  PORTS_CHANNEL channel ) ;
19470 // *****************************************************************************
19471 /* Function:
19472  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19473  Summary:
19474  Reads the selected digital port.
19475  Description:
19476  This function reads from the selected digital port.
19477  This function does not perform atomic register access.
19478  Precondition:
19479  None.
19480  Parameters:
19481  index - Identifier for the device instance to be configured
19482  channel - Identifier for the Ports channel A, B, C, etc.
19483  Returns:
19484  data on a port with width PORTS_DATA_TYPE
19485  Example:
19486  <code>
19487 
19488  // Read PORT C
19489  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19490 
19491  </code>
19492  Remarks:
19493  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19494 
19495  This feature may not be available on all devices. Please refer to the
19496  specific device data sheet to determine availability or use
19497  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19498  this feature is available.
19499 */
19500 
19502  PLIB_PORTS_Read (
19503  PORTS_MODULE_ID index ,
19504  PORTS_CHANNEL channel ) ;
19505 // *****************************************************************************
19506 /* Function:
19507  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19508  PORTS_DATA_TYPE value )
19509  Summary:
19510  Writes the selected digital port/latch.
19511  Description:
19512  This function writes to the selected digital port/latch.
19513  This function does not perform atomic register access.
19514  Precondition:
19515  None.
19516  Parameters:
19517  index - Identifier for the device instance to be configured
19518  channel - Identifier for the Ports channel A, B, C, etc.
19519  value - Value to be written into a port of width PORTS_DATA_TYPE
19520  Returns:
19521  None.
19522  Example:
19523  <code>
19524 
19525  // Write 0x12 into PORT C
19526  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
19527 
19528  </code>
19529  Remarks:
19530  This feature may not be available on all devices. Please refer to the
19531  specific device data sheet to determine availability or use
19532  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19533  this feature is available.
19534 */
19535 
19536 void
19538  PORTS_MODULE_ID index ,
19539  PORTS_CHANNEL channel ,
19540  PORTS_DATA_TYPE value ) ;
19541 // *****************************************************************************
19542 /* Function:
19543  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19544  PORTS_DATA_TYPE value,
19545  PORTS_DATA_MASK mask )
19546  Summary:
19547  Sets the selected bits of the port.
19548  Description:
19549  This function performs an 'AND' operation on the value and mask parameters,
19550  and then sets the bits in the port channel that were set by the result of the
19551  'AND' operation.
19552  This function does not perform atomic register access.
19553  Precondition:
19554  None.
19555  Parameters:
19556  index - Identifier for the device instance to be configured
19557  channel - Identifier for the Ports channel A, B, C, etc.
19558  value - Consists of information about which port bit has to be
19559  set and which not
19560  mask - Identifies the bits which could be intended for setting
19561  Returns:
19562  None.
19563  Example:
19564  <code>
19565 
19566  // MY_VALUE - 0x1234
19567  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
19568 
19569  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
19570  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
19571 
19572  </code>
19573  Remarks:
19574  This feature may not be available on all devices. Please refer to the
19575  specific device data sheet to determine availability or use
19576  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19577  this feature is available.
19578 */
19579 
19580 void
19581  PLIB_PORTS_Set (
19582  PORTS_MODULE_ID index ,
19583  PORTS_CHANNEL channel ,
19584  PORTS_DATA_TYPE value ,
19585  PORTS_DATA_MASK mask ) ;
19586 // *****************************************************************************
19587 /* Function:
19588  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19589  PORTS_DATA_MASK toggleMask )
19590  Summary:
19591  Toggles the selected digital port/latch.
19592  Description:
19593  This function toggles the selected digital port/latch.
19594  This function does not perform atomic register access.
19595  Precondition:
19596  None.
19597  Parameters:
19598  index - Identifier for the device instance to be configured
19599  channel - Identifier for the Ports channel A, B, C, etc.
19600  toggleMask - Identifies the bits to be toggled
19601  Returns:
19602  None.
19603  Example:
19604  <code>
19605 
19606  // Toggles the three least significant Port C bits
19607  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19608 
19609  </code>
19610  Remarks:
19611  This feature may not be available on all devices. Please refer to the
19612  specific device data sheet to determine availability or use
19613  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19614  this feature is available.
19615 */
19616 
19617 void
19619  PORTS_MODULE_ID index ,
19620  PORTS_CHANNEL channel ,
19621  PORTS_DATA_MASK toggleMask ) ;
19622 // *****************************************************************************
19623 /* Function:
19624  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19625  PORTS_DATA_MASK clearMask )
19626  Summary:
19627  Clears the selected digital port/latch bits.
19628  Description:
19629  This function clears the selected digital port/latch bits.
19630  This function does not perform atomic register access.
19631  Precondition:
19632  None.
19633  Parameters:
19634  index - Identifier for the device instance to be configured
19635  channel - Identifier for the Ports channel A, B, C, etc.
19636  clearMask - Identifies the bits to be cleared
19637  Returns:
19638  None.
19639  Example:
19640  <code>
19641 
19642  // Clears the three least significant Port C bits
19643  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19644 
19645  </code>
19646  Remarks:
19647  This feature may not be available on all devices. Please refer to the
19648  specific device data sheet to determine availability or use
19649  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19650  this feature is available.
19651 */
19652 
19653 void
19655  PORTS_MODULE_ID index ,
19656  PORTS_CHANNEL channel ,
19657  PORTS_DATA_MASK clearMask ) ;
19658 // *****************************************************************************
19659 /* Function:
19660  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19661  PORTS_DATA_MASK mask )
19662  Summary:
19663  Makes the selected pins direction input.
19664  Description:
19665  This function makes the selected pins direction input.
19666  This function does not perform atomic register access.
19667 
19668  Precondition:
19669  None.
19670  Parameters:
19671  index - Identifier for the device instance to be configured
19672  channel - Identifier for the Ports channel A, B, C, etc.
19673  mask - Identifies the pins direction that has to be made input
19674  Returns:
19675  None.
19676  Example:
19677  <code>
19678 
19679  // Make RC0, RC1 and RC2 pins as Input
19680  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19681 
19682  </code>
19683  Remarks:
19684  This feature may not be available on all devices. Please refer to the
19685  specific device data sheet to determine availability or use
19686  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19687  this feature is available.
19688 */
19689 
19690 void
19692  PORTS_MODULE_ID index ,
19693  PORTS_CHANNEL channel ,
19694  PORTS_DATA_MASK mask ) ;
19695 // *****************************************************************************
19696 /* Function:
19697  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19698  PORTS_DATA_MASK mask )
19699  Summary:
19700  Makes the selected pins direction output.
19701  Description:
19702  This function makes the selected pins direction output.
19703  This function does not perform atomic register access.
19704  Precondition:
19705  None.
19706  Parameters:
19707  index - Identifier for the device instance to be configured
19708  channel - Identifier for the Ports channel A, B, C, etc.
19709  mask - Identifies the pins direction that has to be made output
19710  Returns:
19711  None.
19712  Example:
19713  <code>
19714 
19715  // Make RC0, RC1 and RC2 pins as Output
19716  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19717 
19718  </code>
19719  Remarks:
19720  This feature may not be available on all devices. Please refer to the
19721  specific device data sheet to determine availability or use
19722  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19723  this feature is available.
19724 */
19725 
19726 void
19728  PORTS_MODULE_ID index ,
19729  PORTS_CHANNEL channel ,
19730  PORTS_DATA_MASK mask ) ;
19731 // *****************************************************************************
19732 /* Function:
19733  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19734  Summary:
19735  Reads the direction of the selected digital port.
19736  Description:
19737  This function reads the direction of the selected digital port.
19738  This function does not perform atomic register access.
19739  Precondition:
19740  None.
19741  Parameters:
19742  index - Identifier for the device instance to be configured
19743  channel - Identifier for the Ports channel A, B, C, etc.
19744  Returns:
19745  Direction of the selected port of type PORTS_DATA_MASK
19746  Example:
19747  <code>
19748 
19749  // Reads the direction of Port C pins
19750  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
19751 
19752  </code>
19753  Remarks:
19754  This feature may not be available on all devices. Please refer to the
19755  specific device data sheet to determine availability or use
19756  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19757  this feature is available.
19758 */
19759 
19762  PORTS_MODULE_ID index ,
19763  PORTS_CHANNEL channel ) ;
19764 // *****************************************************************************
19765 /* Function:
19766  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19767  PORTS_DATA_MASK mask )
19768  Summary:
19769  Enables the open drain functionality for the selected port pins.
19770  Description:
19771  This function enables the open drain functionality for the selected port pins.
19772  This function does not perform atomic register access.
19773  Precondition:
19774  None.
19775  Parameters:
19776  index - Identifier for the device instance to be configured
19777  channel - Identifier for the Ports channel A, B, C, etc.
19778  mask - Identifies the pins for the open drain to be enabled
19779  Returns:
19780  None.
19781  Example:
19782  <code>
19783 
19784  // Enable Open Drain for RC0, RC1 and RC2 pins
19785  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19786 
19787  </code>
19788  Remarks:
19789  This feature may not be available on all devices. Please refer to the
19790  specific device data sheet to determine availability or use
19791  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19792  this feature is available.
19793 */
19794 
19795 void
19797  PORTS_MODULE_ID index ,
19798  PORTS_CHANNEL channel ,
19799  PORTS_DATA_MASK mask ) ;
19800 // *****************************************************************************
19801 /* Function:
19802  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19803  PORTS_DATA_MASK mask )
19804  Summary:
19805  Disables the open drain functionality for the selected port.
19806  Description:
19807  This function disables the open drain functionality for the selected port.
19808  This function does not perform atomic register access.
19809 
19810  Precondition:
19811  None.
19812  Parameters:
19813  index - Identifier for the device instance to be configured
19814  channel - Identifier for the Ports channel A, B, C, etc.
19815  mask - Identifies the pins for the open drain to be disabled
19816  Returns:
19817  None.
19818  Example:
19819  <code>
19820 
19821  // Disable Open Drain for RC0, RC1 and RC2 pins
19822  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19823 
19824  </code>
19825  Remarks:
19826  This feature may not be available on all devices. Please refer to the
19827  specific device data sheet to determine availability or use
19828  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19829  this feature is available.
19830 */
19831 
19832 void
19834  PORTS_MODULE_ID index ,
19835  PORTS_CHANNEL channel ,
19836  PORTS_DATA_MASK mask ) ;
19837 // *****************************************************************************
19838 /* Function:
19839  void PLIB_PORTS_ChannelModeSelect
19840  (
19841  PORTS_MODULE_ID index,
19842  PORTS_CHANNEL channel,
19843  PORTS_DATA_MASK modeMask,
19844  PORTS_PIN_MODE mode
19845  );
19846  Summary:
19847  Enables the selected channel pins as analog or digital.
19848  Description:
19849  This function enables the selected channel pins as analog or digital.
19850  This function does not perform atomic register access.
19851  Precondition:
19852  None.
19853  Parameters:
19854  index - Identifier for the device instance to be configured
19855  channel - Port pin channel
19856  modeMask - Identifies the pins whose mode has to be modified.
19857  Modes of the pins whose corresponding bit is '1' get
19858  modified, mode of the other pins remains the same.
19859  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
19860  Returns:
19861  None.
19862  Example:
19863  <code>
19864 
19865  // Make pins RC5, RC8 and RC13 Analog
19866  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
19867 
19868  </code>
19869  Remarks:
19870  This function is only available in devices with PPS. For Non-PPS devices, use the
19871  PLIB_PORTS_AnPinsModeSelect function.
19872 
19873  This feature may not be available on all devices. Please refer to the
19874  specific device data sheet to determine availability or use
19875  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19876  this feature is available.
19877 */
19878 
19879 void
19881  PORTS_MODULE_ID index ,
19882  PORTS_CHANNEL channel ,
19883  PORTS_DATA_MASK modeMask ,
19884  PORTS_PIN_MODE mode ) ;
19885 // *****************************************************************************
19886 /* Function:
19887  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
19888  (
19889  PORTS_MODULE_ID index,
19890  PORTS_CHANNEL channel,
19891  PORTS_DATA_MASK mask
19892  );
19893  Summary:
19894  Enables Change Notice pull-up for the selected channel pins.
19895  Description:
19896  This function enables the Change Notice pull-up for the selected
19897  channel pins.
19898  This function does not perform atomic register access.
19899  Precondition:
19900  None.
19901  Parameters:
19902  index - Identifier for the device instance to be configured
19903  channel - Port pin channel
19904  mask - Identifies the pins of the pull-up to be enabled
19905  Returns:
19906  None.
19907  Example:
19908  <code>
19909 
19910  // Enable pull-up for RC5, RC8 and RC13 pins
19911  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
19912  0x2120);
19913  </code>
19914  Remarks:
19915  This function is only available in devices with PPS. For Non-PPS devices, use the
19916  PLIB_PORTS_CnPinsPullUpEnable function.
19917 
19918  This feature may not be available on all devices. Please refer to the
19919  specific device data sheet to determine availability or use
19920  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19921  determine whether this feature is available.
19922 */
19923 
19924 void
19926  PORTS_MODULE_ID index ,
19927  PORTS_CHANNEL channel ,
19928  PORTS_DATA_MASK mask ) ;
19929 // *****************************************************************************
19930 /* Function:
19931  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
19932  (
19933  PORTS_MODULE_ID index,
19934  PORTS_CHANNEL channel,
19935  PORTS_DATA_MASK mask
19936  );
19937  Summary:
19938  Disables Change Notice pull-up for the selected channel pins.
19939  Description:
19940  This function Disables the Change Notice pull-up for the selected
19941  channel pins.
19942  PLIB_PORTS_ChannelChangeNoticePullUpDisable
19943  Precondition:
19944  None.
19945  Parameters:
19946  index - Identifier for the device instance to be configured
19947  channel - Port pin channel
19948  mask - Identifies the pins of the pull-up to be disabled
19949  Returns:
19950  None.
19951  Example:
19952  <code>
19953 
19954  // Disable pull-up for RC5, RC8 and RC13 pins
19955  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
19956  0x2120);
19957  </code>
19958  Remarks:
19959  This function is only available in devices with PPS. For Non-PPS devices, use the
19960  PLIB_PORTS_CnPinsPullUpDisable function.
19961 
19962  This feature may not be available on all devices. Please refer to the
19963  specific device data sheet to determine availability or use
19964  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19965  determine whether this feature is available.
19966 */
19967 
19968 void
19970  PORTS_MODULE_ID index ,
19971  PORTS_CHANNEL channel ,
19972  PORTS_DATA_MASK mask ) ;
19973 // *****************************************************************************
19974 /* Function:
19975  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
19976  (
19977  PORTS_MODULE_ID index,
19978  PORTS_CHANNEL channel,
19979  PORTS_DATA_MASK mask
19980  );
19981  Summary:
19982  Enables Change Notice pull-down for the selected channel pins.
19983  Description:
19984  This function enables the Change Notice pull-down for the selected
19985  channel pins.
19986  This function does not perform atomic register access.
19987  Precondition:
19988  None.
19989  Parameters:
19990  index - Identifier for the device instance to be configured
19991  channel - Port pin channel
19992  mask - Identifies the pins for the pull-down to be enabled
19993  Returns:
19994  None.
19995  Example:
19996  <code>
19997 
19998  // Enable pull-down for RC5, RC8 and RC13 pins
19999  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20000  0x2120);
20001  </code>
20002  Remarks:
20003  This feature may not be available on all devices. Please refer to the
20004  specific device data sheet to determine availability or use
20005  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20006  determine whether this feature is available.
20007 */
20008 
20009 void
20011  PORTS_MODULE_ID index ,
20012  PORTS_CHANNEL channel ,
20013  PORTS_DATA_MASK mask ) ;
20014 // *****************************************************************************
20015 /* Function:
20016  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20017  (
20018  PORTS_MODULE_ID index,
20019  PORTS_CHANNEL channel,
20020  PORTS_DATA_MASK mask
20021  );
20022  Summary:
20023  Disables Change Notice pull-down for the selected channel pins.
20024  Description:
20025  This function Disables the Change Notice pull-down for the selected
20026  channel pins.
20027  This function does not perform atomic register access.
20028  Precondition:
20029  None.
20030  Parameters:
20031  index - Identifier for the device instance to be configured
20032  channel - Port pin channel
20033  mask - Identifies the pins for the pull-down to be disabled
20034  Returns:
20035  None.
20036  Example:
20037  <code>
20038 
20039  // Disable pull-down for RC5, RC8 and RC13 pins
20040  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20041  0x2120);
20042  </code>
20043  Remarks:
20044  This feature may not be available on all devices. Please refer to the
20045  specific device data sheet to determine availability or use
20046  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20047  determine whether this feature is available.
20048 */
20049 
20050 void
20052  PORTS_MODULE_ID index ,
20053  PORTS_CHANNEL channel ,
20054  PORTS_DATA_MASK mask ) ;
20055 // *****************************************************************************
20056 /* Function:
20057  void PLIB_PORTS_ChannelChangeNoticeEnable
20058  (
20059  PORTS_MODULE_ID index,
20060  PORTS_CHANNEL channel,
20061  PORTS_DATA_MASK mask
20062  );
20063  Summary:
20064  Enables CN interrupt for the selected pins of a channel.
20065  Description:
20066  This function enables Change Notice interrupt for the selected port
20067  pins of a channel.
20068  This function does not perform atomic register access.
20069  Precondition:
20070  None.
20071  Parameters:
20072  index - Identifier for the device instance to be configured
20073  channel - Port pin channel
20074  mask - Identifies the pins for which change notification is
20075  to be enabled
20076  Returns:
20077  None.
20078  Example:
20079  <code>
20080 
20081  // Enable CN interrupt for RC5, RC8 and RC13 pins
20082  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20083 
20084  </code>
20085  Remarks:
20086  This function is only available in devices with PPS. For Non-PPS devices, use the
20087  PLIB_PORTS_CnPinsEnable function.
20088 
20089  This feature may not be available on all devices. Please refer to the
20090  specific device data sheet to determine availability or use
20091  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20092  determine whether this feature is available.
20093 */
20094 
20095 void
20097  PORTS_MODULE_ID index ,
20098  PORTS_CHANNEL channel ,
20099  PORTS_DATA_MASK mask ) ;
20100 // *****************************************************************************
20101 /* Function:
20102  void PLIB_PORTS_ChannelChangeNoticeDisable
20103  (
20104  PORTS_MODULE_ID index,
20105  PORTS_CHANNEL channel,
20106  PORTS_DATA_MASK mask
20107  );
20108  Summary:
20109  Disables CN interrupt for the selected pins of a channel.
20110  Description:
20111  This function Disables Change Notice interrupt for the selected port
20112  pins of a channel.
20113  This function does not perform atomic register access.
20114  Precondition:
20115  None.
20116  Parameters:
20117  index - Identifier for the device instance to be configured
20118  channel - Port pin channel
20119  mask - Identifies the pins for which change notification is
20120  to be disabled
20121  Returns:
20122  None.
20123  Example:
20124  <code>
20125 
20126  // Disable CN interrupt for RC5, RC8 and RC13 pins
20127  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20128 
20129  </code>
20130  Remarks:
20131  This function is only available in devices with PPS. For Non-PPS devices, use the
20132  PLIB_PORTS_CnPinsDisable function.
20133 
20134  This feature may not be available on all devices. Please refer to the
20135  specific device data sheet to determine availability or use
20136  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20137  determine whether this feature is available.
20138 */
20139 
20140 void
20142  PORTS_MODULE_ID index ,
20143  PORTS_CHANNEL channel ,
20144  PORTS_DATA_MASK mask ) ;
20145 // *****************************************************************************
20146 /* Function:
20147  void PLIB_PORTS_AnPinsModeSelect
20148  (
20149  PORTS_MODULE_ID index,
20150  PORTS_AN_PIN anPins,
20151  PORTS_PIN_MODE mode
20152  );
20153  Summary:
20154  Enables the selected AN pins as analog or digital.
20155  Description:
20156  This function enables the selected AN pins as analog or digital.
20157  This function does not perform atomic register access.
20158  Precondition:
20159  None.
20160  Parameters:
20161  index - Identifier for the device instance to be configured
20162  anPins - AN pins whose mode is to be changed. Multiple AN pins
20163  can be ORed.
20164  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20165  Returns:
20166  None.
20167  Example:
20168  <code>
20169 
20170  // Make pins AN5, AN8 and AN13 Analog
20171  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20172  PORTS_AN_PIN_8 |
20173  PORTS_AN_PIN_13,
20174  PORTS_PIN_MODE_ANALOG);
20175 
20176  </code>
20177  Remarks:
20178  This function is only available in devices without PPS feature. For PPS
20179  devices, use the PLIB_PORTS_ChannelModeSelect function.
20180 
20181  This feature may not be available on all devices. Please refer to the
20182  specific device data sheet to determine availability or use
20183  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20184  this feature is available.
20185 */
20186 
20187 void
20189  PORTS_MODULE_ID index ,
20190  PORTS_AN_PIN anPins ,
20191  PORTS_PIN_MODE mode ) ;
20192 // *****************************************************************************
20193 /* Function:
20194  void PLIB_PORTS_CnPinsPullUpEnable
20195  (
20196  PORTS_MODULE_ID index,
20197  PORTS_CN_PIN cnPins
20198  );
20199  Summary:
20200  Enables Change Notice pull-up for the selected channel pins.
20201  Description:
20202  This function enables the Change Notice pull-up for the selected
20203  channel pins.
20204  This function performs atomic register access.
20205  Precondition:
20206  None.
20207  Parameters:
20208  index - Identifier for the device instance to be configured
20209  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20210  can be ORed.
20211  Returns:
20212  None.
20213  Example:
20214  <code>
20215 
20216  // Enable pull-up for CN5, CN8 and CN13 pins
20217  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20218  CHANGE_NOTICE_PIN_8 |
20219  CHANGE_NOTICE_PIN_13);
20220 
20221  </code>
20222  Remarks:
20223  This function is only available in devices without PPS feature. For PPS
20224  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20225 
20226  This feature may not be available on all devices. Please refer to the
20227  specific device data sheet to determine availability or use
20228  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20229  determine whether this feature is available.
20230 */
20231 
20232 void
20234  PORTS_MODULE_ID index ,
20235  PORTS_CN_PIN cnPins ) ;
20236 // *****************************************************************************
20237 /* Function:
20238  void PLIB_PORTS_CnPinsPullUpDisable
20239  (
20240  PORTS_MODULE_ID index,
20241  PORTS_CN_PIN cnPins
20242  );
20243  Summary:
20244  Disables Change Notice pull-up for the selected channel pins.
20245  Description:
20246  This function Disables the Change Notice pull-up for the selected
20247  channel pins.
20248  This function performs atomic register access.
20249  Precondition:
20250  None.
20251  Parameters:
20252  index - Identifier for the device instance to be configured
20253  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20254  can be ORed.
20255  Returns:
20256  None.
20257  Example:
20258  <code>
20259 
20260  // Disable pull-up for CN5, CN8 and CN13 pins
20261  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20262  CHANGE_NOTICE_PIN_5 |
20263  CHANGE_NOTICE_PIN_8 |
20264  CHANGE_NOTICE_PIN_13);
20265 
20266  </code>
20267  Remarks:
20268  This function is only available in devices without PPS feature. For PPS
20269  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20270 
20271  This feature may not be available on all devices. Please refer to the
20272  specific device data sheet to determine availability or use
20273  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20274  determine whether this feature is available.
20275 */
20276 
20277 void
20279  PORTS_MODULE_ID index ,
20280  PORTS_CN_PIN cnPins ) ;
20281 // *****************************************************************************
20282 /* Function:
20283  void PLIB_PORTS_CnPinsEnable
20284  (
20285  PORTS_MODULE_ID index,
20286  PORTS_CN_PIN cnPins
20287  );
20288  Summary:
20289  Enables CN interrupt for the selected pins of a channel.
20290  Description:
20291  This function enables Change Notice interrupt for the selected port
20292  pins of a channel.
20293  This function performs atomic register access.
20294  Precondition:
20295  None.
20296  Parameters:
20297  index - Identifier for the device instance to be configured
20298  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20299  Returns:
20300  None.
20301  Example:
20302  <code>
20303 
20304  // Enable CN interrupt for CN5, CN8 and CN13 pins
20305  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20306  CHANGE_NOTICE_PIN_5 |
20307  CHANGE_NOTICE_PIN_8 |
20308  CHANGE_NOTICE_PIN_13);
20309 
20310  </code>
20311  Remarks:
20312  This function is only available in devices without PPS feature. For PPS
20313  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20314 
20315  This feature may not be available on all devices. Please refer to the
20316  specific device data sheet to determine availability or use
20317  PLIB_PORTS_ExistsPinChangeNotice in your application to
20318  determine whether this feature is available.
20319 */
20320 
20321 void
20323  PORTS_MODULE_ID index ,
20324  PORTS_CN_PIN cnPins ) ;
20325 // *****************************************************************************
20326 /* Function:
20327  void PLIB_PORTS_CnPinsDisable
20328  (
20329  PORTS_MODULE_ID index,
20330  PORTS_CN_PIN cnPins
20331  );
20332  Summary:
20333  Disables CN interrupt for the selected pins of a channel.
20334  Description:
20335  This function Disables Change Notice interrupt for the selected port
20336  pins of a channel.
20337  This function performs atomic register access.
20338  Precondition:
20339  None.
20340  Parameters:
20341  index - Identifier for the device instance to be configured
20342  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20343  Returns:
20344  None.
20345  Example:
20346  <code>
20347 
20348  // Disable CN interrupt for CN5, CN8 and CN13 pins
20349  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20350  CHANGE_NOTICE_PIN_5 |
20351  CHANGE_NOTICE_PIN_8 |
20352  CHANGE_NOTICE_PIN_13);
20353 
20354  </code>
20355  Remarks:
20356  This function is only available in devices without PPS feature. For PPS
20357  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20358 
20359  This feature may not be available on all devices. Please refer to the
20360  specific device data sheet to determine availability or use
20361  PLIB_PORTS_ExistsPinChangeNotice in your application to
20362  determine whether this feature is available.
20363 */
20364 
20365 void
20367  PORTS_MODULE_ID index ,
20368  PORTS_CN_PIN cnPins ) ;
20369 // *****************************************************************************
20370 /* Function:
20371  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20372  Summary:
20373  Global Change Notice enable.
20374  Description:
20375  This function enables the global Change Notice feature.
20376  This function performs atomic register access.
20377  Precondition:
20378  None.
20379  Parameters:
20380  index - Identifier for the device instance to be configured
20381  Returns:
20382  None.
20383  Example:
20384  <code>
20385 
20386  // Enable Change Notification
20387  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20388 
20389  </code>
20390  Remarks:
20391  This function is only available in devices without PPS. For PPS devices, use the
20392  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20393 
20394  This feature may not be available on all devices. Please refer to the
20395  specific device data sheet to determine availability or use
20396  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20397  this feature is available.
20398 */
20399 
20400 void
20402  PORTS_MODULE_ID index ) ;
20403 // *****************************************************************************
20404 /* Function:
20405  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20406  Summary:
20407  Global Change Notice disable.
20408  Description:
20409  This function disables the global Change Notice feature.
20410  Precondition:
20411  None.
20412  Parameters:
20413  index - Identifier for the device instance to be configured
20414  Returns:
20415  None.
20416  Example:
20417  <code>
20418 
20419  // Disable Change Notification
20420  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20421 
20422  </code>
20423  Remarks:
20424  This function is only available in devices without PPS. For PPS devices, use the
20425  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20426 
20427  This feature may not be available on all devices. Please refer to the
20428  specific device data sheet to determine availability or use
20429  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20430  this feature is available.
20431 */
20432 
20433 void
20435  PORTS_MODULE_ID index ) ;
20436 // *****************************************************************************
20437 /* Function:
20438  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20439  PORTS_CHANGE_NOTICE_PIN pinNum )
20440  Summary:
20441  Port pin Change Notice interrupt enable.
20442  Description:
20443  This function enables the port pin Change Notice feature.
20444  This function performs atomic register access.
20445  Precondition:
20446  None.
20447  Parameters:
20448  index - Identifier for the device instance to be configured
20449  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20450  Returns:
20451  None.
20452  Example:
20453  <code>
20454 
20455  // Enable Change Notice interrupt for pin CN13
20456  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20457 
20458  </code>
20459  Remarks:
20460  This function is only available in devices without PPS. For PPS devices, use the
20461  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20462 
20463  This feature may not be available on all devices. Please refer to the
20464  specific device data sheet to determine availability or use
20465  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20466  this feature is available.
20467 */
20468 
20469 void
20471  PORTS_MODULE_ID index ,
20472  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20473 // *****************************************************************************
20474 /* Function:
20475  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20476  PORTS_CHANGE_NOTICE_PIN pinNum )
20477  Summary:
20478  Port pin Change Notice disable.
20479  Description:
20480  This function disables the port pin Change Notice feature.
20481  This function performs atomic register access.
20482  Precondition:
20483  None.
20484  Parameters:
20485  index - Identifier for the device instance to be configured
20486  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20487  Returns:
20488  None.
20489  Example:
20490  <code>
20491 
20492  // Disable Change Notice interrupt for pin CN13
20493  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20494 
20495  </code>
20496  Remarks:
20497  This function is only available in devices without PPS. For PPS devices, use the
20498  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20499 
20500  This feature may not be available on all devices. Please refer to the
20501  specific device data sheet to determine availability or use
20502  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20503  this feature is available.
20504 */
20505 
20506 void
20508  PORTS_MODULE_ID index ,
20509  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20510 // *****************************************************************************
20511 /* Function:
20512  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20513  Summary:
20514  CPU Idle mode does not affect Change Notice operation.
20515  Description:
20516  This function makes sure that Change Notice feature continues working in
20517  Idle mode.
20518  This function performs atomic register access.
20519 
20520  Precondition:
20521  None.
20522  Parameters:
20523  index - Identifier for the device instance to be configured
20524  Returns:
20525  None.
20526  Example:
20527  <code>
20528 
20529  // Change notification feature will be working even when CPU goes to
20530  // Idle mode
20531  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
20532 
20533  </code>
20534  Remarks:
20535  This function is only available in devices without PPS. For PPS devices, use the
20536  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
20537 
20538  This feature may not be available on all devices. Please refer to the
20539  specific device data sheet to determine availability or use
20540  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20541  this feature is available.
20542 */
20543 
20544 void
20546  PORTS_MODULE_ID index ) ;
20547 // *****************************************************************************
20548 /* Function:
20549  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
20550  Summary:
20551  CPU Idle halts the Change Notice operation.
20552  Description:
20553  This function halts the Change Notice operation when the CPU enters
20554  Idle mode.
20555  This function performs atomic register access.
20556  Precondition:
20557  None.
20558  Parameters:
20559  index - Identifier for the device instance to be configured
20560  Returns:
20561  None.
20562  Example:
20563  <code>
20564  // Halts the Change notification operation when CPU enters Idle mode
20565  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
20566 
20567  </code>
20568  Remarks:
20569  This function is only available in devices without PPS. For PPS devices, use the
20570  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
20571 
20572  This feature may not be available on all devices. Please refer to the
20573  specific device data sheet to determine availability or use
20574  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20575  this feature is available.
20576 */
20577 
20578 void
20580  PORTS_MODULE_ID index ) ;
20581 // *****************************************************************************
20582 /* Function:
20583  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
20584  PORTS_CHANGE_NOTICE_PIN pinNum )
20585  Summary:
20586  Enable pull-up on input change.
20587  Description:
20588  This function enables pull-up on selected input change notification pin.
20589  This function performs atomic register access.
20590  Precondition:
20591  None.
20592  Parameters:
20593  index - Identifier for the device instance to be configured
20594  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20595  Returns:
20596  None.
20597  Example:
20598  <code>
20599 
20600  // Enable pull-up on pin CN13
20601  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
20602 
20603  </code>
20604  Remarks:
20605  This function is only available in devices without PPS. For PPS devices, use the
20606  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
20607 
20608  This feature may not be available on all devices. Please refer to the
20609  specific device data sheet to determine availability or use
20610  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20611  this feature is available.
20612 */
20613 
20614 void
20616  PORTS_MODULE_ID index ,
20617  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20618 // *****************************************************************************
20619 /* Function:
20620  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
20621  PORTS_CHANGE_NOTICE_PIN pinNum )
20622  Summary:
20623  Disable pull-up on input change.
20624  Description:
20625  This function disables pull-up on selected input change notification pin.
20626  This function performs atomic register access.
20627  Precondition:
20628  None.
20629  Parameters:
20630  index - Identifier for the device instance to be configured
20631  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20632  Returns:
20633  None.
20634  Example:
20635  <code>
20636 
20637  // Disable pull-up on pin CN13
20638  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
20639 
20640  </code>
20641  Remarks:
20642  This function is only available in devices without PPS. For PPS devices, use the
20643  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
20644 
20645  This feature may not be available on all devices. Please refer to the
20646  specific device data sheet to determine availability or use
20647  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20648  this feature is available.
20649 */
20650 
20651 void
20653  PORTS_MODULE_ID index ,
20654  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20655 // *****************************************************************************
20656 /* Function:
20657  void PLIB_PORTS_ChannelSlewRateSelect
20658  (
20659  PORTS_MODULE_ID index,
20660  PORTS_CHANNEL channel,
20661  PORTS_DATA_MASK channelMask,
20662  PORTS_PIN_SLEW_RATE slewRate
20663  );
20664  Summary:
20665  Selects the slew rate for selected channel pins.
20666  Description:
20667  This function selects the slew rate for selected channel pins.
20668  This function does not perform atomic register access.
20669  Precondition:
20670  None.
20671  Parameters:
20672  index - Identifier for the device instance to be configured
20673  channel - Port pin channel
20674  channelMask - Identifies the pins for which slew rate has to be modified.
20675  Slew rate of the pins which corresponding bit is "1" get
20676  modified, slew rate of the other pins remains the same.
20677  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
20678  Returns:
20679  None.
20680  Example:
20681  <code>
20682 
20683  // Make slew rate of pins RC5, RC8 and RC13 slowest
20684  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
20685  PORT_CHANNEL_C,
20686  0x2120,
20687  PORTS_PIN_SLEW_RATE_SLOWEST);
20688 
20689  </code>
20690  Remarks:
20691  This feature may not be available on all devices. Please refer to the
20692  specific device data sheet to determine availability or use
20693  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20694  whether this feature is available.
20695 */
20696 
20697 void
20699  PORTS_MODULE_ID index ,
20700  PORTS_CHANNEL channel ,
20701  PORTS_DATA_MASK channelMask ,
20702  PORTS_PIN_SLEW_RATE slewRate ) ;
20703 // *****************************************************************************
20704 /* Function:
20705 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
20706  (
20707  PORTS_MODULE_ID index,
20708  PORTS_CHANNEL channel,
20709  PORTS_BIT_POS bitPos
20710  );
20711  Summary:
20712  Gets the slew rate for selected port pin.
20713  Description:
20714  This function gets the slew rate of selected port pin.
20715  This function does not perform atomic register access.
20716  Precondition:
20717  None.
20718  Parameters:
20719  index - Identifier for the device instance to be configured
20720  channel - Port pin channel
20721  bitPos - One of the possible values of PORTS_BIT_POS.
20722  Returns:
20723  One of the possible values of PORTS_PIN_SLEW_RATE.
20724  Example:
20725  <code>
20726  PORTS_PIN_SLEW_RATE slewRate;
20727 
20728  // Get the slew rate of pin RC1
20729  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
20730 
20731  </code>
20732  Remarks:
20733  This feature may not be available on all devices. Please refer to the
20734  specific device data sheet to determine availability or use
20735  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20736  whether this feature is available.
20737 */
20738 
20739 PORTS_PIN_SLEW_RATE
20741  PORTS_MODULE_ID index ,
20742  PORTS_CHANNEL channel ,
20743  PORTS_BIT_POS bitPos ) ;
20744 // *****************************************************************************
20745 /* Function:
20746  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
20747  (
20748  PORTS_MODULE_ID index,
20749  PORTS_CHANNEL channel,
20750  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
20751  );
20752  Summary:
20753  Selects the Change Notice style for selected port channel.
20754  Description:
20755  This function selects the Change Notice style (or method) for selected port
20756  channel. It allows user to select whether the Change Notice detection will
20757  happen based on edge transition or level transition on all the CN pins of a
20758  particular channel.
20759  This function does not perform atomic register access.
20760  Precondition:
20761  None.
20762  Parameters:
20763  index - Identifier for the device instance to be configured
20764  channel - Port pin channel
20765  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20766  Returns:
20767  None.
20768  Example:
20769  <code>
20770  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
20771  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
20772  </code>
20773  Remarks:
20774  This feature may not be available on all devices. Please refer to the
20775  specific device data sheet to determine availability or use
20776  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20777  whether this feature is available.
20778 */
20779 
20780 void
20782  PORTS_MODULE_ID index ,
20783  PORTS_CHANNEL channel ,
20784  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
20785 // *****************************************************************************
20786 /* Function:
20787  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
20788  (
20789  PORTS_MODULE_ID index,
20790  PORTS_CHANNEL channel
20791  );
20792  Summary:
20793  Gets the Change Notice style for the selected port channel.
20794  Description:
20795  This function gets the Change Notice style (or method) for the selected port
20796  channel.
20797  This function does not perform atomic register access.
20798  Precondition:
20799  None.
20800  Parameters:
20801  index - Identifier for the device instance to be configured
20802  channel - Port pin channel
20803  Returns:
20804  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20805  Example:
20806  <code>
20807  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
20808  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
20809  </code>
20810  Remarks:
20811  This feature may not be available on all devices. Please refer to the
20812  specific device data sheet to determine availability or use
20813  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20814  whether this feature is available.
20815 */
20816 
20817 PORTS_CHANGE_NOTICE_METHOD
20819  PORTS_MODULE_ID index ,
20820  PORTS_CHANNEL channel ) ;
20821 // *****************************************************************************
20822 /* Function:
20823  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
20824  (
20825  PORTS_MODULE_ID index,
20826  PORTS_CHANNEL channel,
20827  PORTS_DATA_MASK edgeRisingMask,
20828  PORTS_DATA_MASK edgeFallingMask
20829  );
20830  Summary:
20831  Enables selected type of edge for selected CN pins.
20832  Description:
20833  This function Enables selected type of edge (falling or rising) for
20834  selected CN pins of a port channel.
20835  This function does not perform atomic register access.
20836  Precondition:
20837  Change Notice method should be selected as
20838  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20839  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20840  Parameters:
20841  index - Identifier for the device instance to be configured
20842  channel - Port pin channel
20843  edgeRisingMask - Identifies the pins for which Change Notice has to be
20844  enabled for rising edge. Change Notice interrupt at rising
20845  edge is enabled for the pins which corresponding bit is
20846  '1', for the other pins it remains the same.
20847  edgeFallingMask - Identifies the pins for which Change Notice has to be
20848  enabled for falling edge. Change Notice interrupt at
20849  falling edge is enabled for the pins which corresponding
20850  bit is '1', for the other pins it remains the same.
20851  Returns:
20852  None.
20853  Example:
20854  <code>
20855  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
20856  // RC1 & RC5 pins.
20857  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20858  </code>
20859  Remarks:
20860  This feature is not available on all devices. Please refer to the
20861  specific device data sheet to determine availability or use
20862  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20863  whether this feature is available.
20864 */
20865 
20866 void
20868  PORTS_MODULE_ID index ,
20869  PORTS_CHANNEL channel ,
20870  PORTS_DATA_MASK edgeRisingMask ,
20871  PORTS_DATA_MASK edgeFallingMask ) ;
20872 // *****************************************************************************
20873 /* Function:
20874  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
20875  (
20876  PORTS_MODULE_ID index,
20877  PORTS_CHANNEL channel,
20878  PORTS_DATA_MASK edgeRisingMask,
20879  PORTS_DATA_MASK edgeFallingMask
20880  );
20881  Summary:
20882  Disables selected type of edge for selected CN pins.
20883  Description:
20884  This function Disables selected type of edge (falling or rising) for
20885  selected CN pins of a port channel.
20886  This function does not perform atomic register access.
20887  Precondition:
20888  Change Notice method should be selected as
20889  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20890  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20891  Parameters:
20892  index - Identifier for the device instance to be configured
20893  channel - Port pin channel
20894  edgeRisingMask - Identifies the pins for which Change Notice has to be
20895  enabled for rising edge. Change notice interrupt at rising
20896  edge is enabled for the pins which corresponding bit is
20897  '1', for the other pins it remains the same.
20898  edgeFallingMask - Identifies the pins for which Change Notice has to be
20899  enabled for falling edge. Change notice interrupt at
20900  falling edge is enabled for the pins which corresponding
20901  bit is '1', for the other pins it remains the same.
20902  Returns:
20903  None.
20904  Example:
20905  <code>
20906  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
20907  // RC1 & RC5 pins.
20908  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20909  </code>
20910  Remarks:
20911  This feature is not available on all devices. Please refer to the
20912  specific device data sheet to determine availability or use
20913  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20914  whether this feature is available.
20915 */
20916 
20917 void
20919  PORTS_MODULE_ID index ,
20920  PORTS_CHANNEL channel ,
20921  PORTS_DATA_MASK edgeRisingMask ,
20922  PORTS_DATA_MASK edgeFallingMask ) ;
20923 // *****************************************************************************
20924 /* Function:
20925  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
20926  (
20927  PORTS_MODULE_ID index,
20928  PORTS_CHANNEL channel,
20929  PORTS_BIT_POS bitPos,
20930  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
20931  );
20932  Summary:
20933  Check if Change Notice edge is enabled or not.
20934  This function does not perform atomic register access.
20935  Description:
20936  This function checks if selected type of Change Notice edge is enabled on a
20937  particular port pin or not.
20938  This function does not perform atomic register access.
20939  Precondition:
20940  None.
20941  Parameters:
20942  index - Identifier for the device instance to be configured
20943  channel - Port pin channel
20944  bitPos - One of the possible values of PORTS_BIT_POS.
20945  cnEdgeType - Type of the edge which has to be checked.
20946 
20947  Returns:
20948  - true - Selected type of Change Notice Edge is enabled.
20949  - false - Selected type of Change Notice Edge is not enabled.
20950 
20951  Example:
20952  <code>
20953  // Check if Change Notice at rising edge is enabled or not for pin RC1.
20954  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
20955  {
20956  // do something
20957  }
20958  </code>
20959  Remarks:
20960  This feature is not available on all devices. Please refer to the
20961  specific device data sheet to determine availability or use
20962  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20963  whether this feature is available.
20964 */
20965 
20966 bool
20968  PORTS_MODULE_ID index ,
20969  PORTS_CHANNEL channel ,
20970  PORTS_BIT_POS bitPos ,
20971  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
20972 // *****************************************************************************
20973 /* Function:
20974  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
20975  (
20976  PORTS_MODULE_ID index,
20977  PORTS_CHANNEL channel,
20978  PORTS_BIT_POS bitPos
20979  );
20980  Summary:
20981  Check Change Notice edge status.
20982  Description:
20983  This function checks whether or no a Change Notice edge transition has occurred
20984  on the selected port pin.
20985  This function does not perform atomic register access.
20986  Precondition:
20987  None.
20988  Parameters:
20989  index - Identifier for the device instance to be configured
20990  channel - Port pin channel
20991  bitPos - One of the possible values of PORTS_BIT_POS
20992 
20993  Returns:
20994  - true - Change Notice edge transition has occurred
20995  - false - Change Notice edge transition has not occurred
20996 
20997  Example:
20998  <code>
20999  // Check if Change Notice edge transition has occurred for pin RC1.
21000  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21001  {
21002  // do something
21003  }
21004  </code>
21005  Remarks:
21006  This feature is not available on all devices. Please refer to the
21007  specific device data sheet to determine availability or use
21008  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21009  whether this feature is available.
21010 */
21011 
21012 bool
21014  PORTS_MODULE_ID index ,
21015  PORTS_CHANNEL channel ,
21016  PORTS_BIT_POS bitPos ) ;
21017 // *****************************************************************************
21018 // *****************************************************************************
21019 // Section: Ports Peripheral Library Exists Functions
21020 // *****************************************************************************
21021 // *****************************************************************************
21022 /* The functions below indicate the existence of the features on the device.
21023 */
21024 //******************************************************************************
21025 /* Function:
21026  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21027  Summary:
21028  Identifies whether the RemapInput feature exists on the Ports module.
21029  Description:
21030  This function identifies whether the RemapInput feature is available on the
21031  Ports module.
21032  When this function returns true, this function is supported on the device:
21033  - PLIB_PORTS_RemapInput
21034  Preconditions:
21035  None.
21036  Parameters:
21037  index - Identifier for the device instance
21038  Returns:
21039  - true - The RemapInput feature is supported on the device
21040  - false - The RemapInput feature is not supported on the device
21041  Remarks:
21042  None.
21043 */
21044 
21045 bool
21047  PORTS_MODULE_ID index ) ;
21048 //******************************************************************************
21049 /* Function:
21050  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21051  Summary:
21052  Identifies whether the RemapOutput feature exists on the Ports module.
21053  Description:
21054  This function identifies whether the RemapOutput feature is available on the
21055  Ports module.
21056  When this function returns true, this function is supported on the device:
21057  - PLIB_PORTS_RemapOutput
21058  Preconditions:
21059  None.
21060  Parameters:
21061  index - Identifier for the device instance
21062  Returns:
21063  - true - The RemapOutput feature is supported on the device
21064  - false - The RemapOutput feature is not supported on the device
21065  Remarks:
21066  None.
21067 */
21068 
21069 bool
21071  PORTS_MODULE_ID index ) ;
21072 //******************************************************************************
21073 /* Function:
21074  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21075  Summary:
21076  Identifies whether the PinMode feature exists on the Ports module.
21077  Description:
21078  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21079  feature is available on the Ports module.
21080  When this function returns true, this function is supported on the device:
21081  - PLIB_PORTS_PinModeSelect
21082  Preconditions:
21083  None.
21084  Parameters:
21085  index - Identifier for the device instance
21086  Returns:
21087  - true - The PinMode feature is supported on the device
21088  - false - The PinMode feature is not supported on the device
21089  Remarks:
21090  None.
21091 */
21092 
21093 bool
21095  PORTS_MODULE_ID index ) ;
21096 //******************************************************************************
21097 /* Function:
21098  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21099  Summary:
21100  Identifies whether the AnPinsMode feature exists on the Ports module.
21101  Description:
21102  This function identifies whether the AnPinsMode feature is available on the
21103  Ports module.
21104  When this function returns true, this function is supported on the device:
21105  - PLIB_PORTS_AnPinsModeSelect
21106  Preconditions:
21107  None.
21108  Parameters:
21109  index - Identifier for the device instance
21110  Returns:
21111  - true - The AnPinsMode feature is supported on the device
21112  - false - The AnPinsMode feature is not supported on the device
21113  Remarks:
21114  None.
21115 */
21116 
21117 bool
21119  PORTS_MODULE_ID index ) ;
21120 //******************************************************************************
21121 /* Function:
21122  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21123  Summary:
21124  Identifies whether the PortsRead feature exists on the Ports module.
21125  Description:
21126  This function identifies whether the PortsRead feature is available on the
21127  Ports module.
21128  When this function returns true, these functions are supported on the device:
21129  - PLIB_PORTS_PinGet
21130  - PLIB_PORTS_Read
21131  Preconditions:
21132  None.
21133  Parameters:
21134  index - Identifier for the device instance
21135  Returns:
21136  - true - The PortsRead feature is supported on the device
21137  - false - The PortsRead feature is not supported on the device
21138  Remarks:
21139  None.
21140 */
21141 
21142 bool
21144  PORTS_MODULE_ID index ) ;
21145 //******************************************************************************
21146 /* Function:
21147  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21148  Summary:
21149  Identifies whether the LatchRead feature exists on the Ports module.
21150  Description:
21151  This function identifies whether the LatchRead feature is available on the
21152  Ports module.
21153  When this function returns true, these functions are supported on the device:
21154  - PLIB_PORTS_PinGetLatched
21155  - PLIB_PORTS_ReadLatched
21156  Preconditions:
21157  None.
21158  Parameters:
21159  index - Identifier for the device instance
21160  Returns:
21161  - true - The LatchRead feature is supported on the device
21162  - false - The LatchRead feature is not supported on the device
21163  Remarks:
21164  None.
21165 */
21166 
21167 bool
21169  PORTS_MODULE_ID index ) ;
21170 //******************************************************************************
21171 /* Function:
21172  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21173  Summary:
21174  Identifies whether the PortsWrite feature exists on the Ports module.
21175  Description:
21176  This function identifies whether the PortsWrite feature is available on the
21177  Ports module.
21178  When this function returns true, these functions are supported on the device:
21179  - PLIB_PORTS_PinWrite
21180  - PLIB_PORTS_PinSet
21181  - PLIB_PORTS_PinClear
21182  - PLIB_PORTS_PinToggle
21183  - PLIB_PORTS_Write
21184  - PLIB_PORTS_Set
21185  - PLIB_PORTS_Toggle
21186  - PLIB_PORTS_Clear
21187  Preconditions:
21188  None.
21189  Parameters:
21190  index - Identifier for the device instance
21191  Returns:
21192  - true - The PortsWrite feature is supported on the device
21193  - false - The PortsWrite feature is not supported on the device
21194  Remarks:
21195  None.
21196 */
21197 
21198 bool
21200  PORTS_MODULE_ID index ) ;
21201 //******************************************************************************
21202 /* Function:
21203  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21204  Summary:
21205  Identifies whether the PortsDirection feature exists on the Ports module.
21206  Description:
21207  This function identifies whether the PortsDirection feature is available on the
21208  Ports module.
21209  When this function returns true, these functions are supported on the device:
21210  - PLIB_PORTS_PinDirectionInputSet
21211  - PLIB_PORTS_PinDirectionOutputSet
21212  - PLIB_PORTS_DirectionInputSet
21213  - PLIB_PORTS_DirectionOutputSet
21214  - PLIB_PORTS_DirectionGet
21215  Preconditions:
21216  None.
21217  Parameters:
21218  index - Identifier for the device instance
21219  Returns:
21220  - true - The PortsDirection feature is supported on the device
21221  - false - The PortsDirection feature is not supported on the device
21222  Remarks:
21223  None.
21224 */
21225 
21226 bool
21228  PORTS_MODULE_ID index ) ;
21229 //******************************************************************************
21230 /* Function:
21231  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21232  Summary:
21233  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21234  Description:
21235  This function identifies whether the PortsOpenDrain feature is available on
21236  the Ports module.
21237  When this function returns true, these functions are supported on the device:
21238  - PLIB_PORTS_PinOpenDrainEnable
21239  - PLIB_PORTS_PinOpenDrainDisable
21240  - PLIB_PORTS_OpenDrainEnable
21241  - PLIB_PORTS_OpenDrainDisable
21242  Preconditions:
21243  None.
21244  Parameters:
21245  index - Identifier for the device instance
21246  Returns:
21247  - true - The PortsOpenDrain feature is supported on the device
21248  - false - The PortsOpenDrain feature is not supported on the device
21249  Remarks:
21250  None.
21251 */
21252 
21253 bool
21255  PORTS_MODULE_ID index ) ;
21256 //******************************************************************************
21257 /* Function:
21258  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21259  Summary:
21260  Identifies whether the ChangeNotice feature exists on the Ports module.
21261  Description:
21262  This function identifies whether the ChangeNotice feature is available on the
21263  Ports module.
21264  When this function returns true, these functions are supported on the device:
21265  - PLIB_PORTS_ChangeNoticeEnable
21266  - PLIB_PORTS_ChangeNoticeDisable
21267  Preconditions:
21268  None.
21269  Parameters:
21270  index - Identifier for the device instance
21271  Returns:
21272  - true - The ChangeNotice feature is supported on the device
21273  - false - The ChangeNotice feature is not supported on the device
21274  Remarks:
21275  None.
21276 */
21277 
21278 bool
21280  PORTS_MODULE_ID index ) ;
21281 //******************************************************************************
21282 /* Function:
21283  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21284  Summary:
21285  Identifies whether the PinChangeNotice feature exists on the Ports module.
21286  Description:
21287  This function identifies whether the PinChangeNotice feature is available on
21288  the Ports module.
21289  When this function returns true, these functions are supported on the device:
21290  - PLIB_PORTS_PinChangeNoticeEnable
21291  - PLIB_PORTS_PinChangeNoticeDisable
21292  - PLIB_PORTS_CnPinsEnable
21293  - PLIB_PORTS_CnPinsDisable
21294  Preconditions:
21295  None.
21296  Parameters:
21297  index - Identifier for the device instance
21298  Returns:
21299  - true - The PinChangeNotice feature is supported on the device
21300  - false - The PinChangeNotice feature is not supported on the device
21301  Remarks:
21302  None.
21303 */
21304 
21305 bool
21307  PORTS_MODULE_ID index ) ;
21308 //******************************************************************************
21309 /* Function:
21310  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21311  Summary:
21312  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21313  Description:
21314  This function identifies whether the ChangeNoticeInIdle feature is available
21315  on the Ports module.
21316  When this function returns true, these functions are supported on the device:
21317  - PLIB_PORTS_ChangeNoticeInIdleEnable
21318  - PLIB_PORTS_ChangeNoticeInIdleDisable
21319  Preconditions:
21320  None.
21321  Parameters:
21322  index - Identifier for the device instance
21323  Returns:
21324  - true - The ChangeNoticeInIdle feature is supported on the device
21325  - false - The ChangeNoticeInIdle feature is not supported on the device
21326  Remarks:
21327  None.
21328 */
21329 
21330 bool
21332  PORTS_MODULE_ID index ) ;
21333 //******************************************************************************
21334 /* Function:
21335  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21336  Summary:
21337  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21338  Description:
21339  This function identifies whether the ChangeNoticePullup feature is available
21340  on the Ports module.
21341  When this function returns true, these functions are supported on the device:
21342  - PLIB_PORTS_ChangeNoticePullUpEnable
21343  - PLIB_PORTS_ChangeNoticePullUpDisable
21344  - PLIB_PORTS_CnPinsPullUpEnable
21345  - PLIB_PORTS_CnPinsPullUpDisable
21346  Preconditions:
21347  None.
21348  Parameters:
21349  index - Identifier for the device instance
21350  Returns:
21351  - true - The ChangeNoticePullup feature is supported on the device
21352  - false - The ChangeNoticePullup feature is not supported on the device
21353  Remarks:
21354  None.
21355 */
21356 
21357 bool
21359  PORTS_MODULE_ID index ) ;
21360 //******************************************************************************
21361 /* Function:
21362  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21363  Summary:
21364  Identifies whether the PinModePerPort feature exists on the Ports module.
21365  Description:
21366  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21367  feature is available on the Ports module.
21368  When this function returns true, these functions are supported on the device:
21369  - PLIB_PORTS_PinModePerPortSelect
21370  - PLIB_PORTS_ChannelModeSelect
21371  Preconditions:
21372  None.
21373  Parameters:
21374  index - Identifier for the device instance
21375  Returns:
21376  - true - The PinModePerPort feature is supported on the device
21377  - false - The PinModePerPort feature is not supported on the device
21378  Remarks:
21379  None.
21380 */
21381 
21382 bool
21384  PORTS_MODULE_ID index ) ;
21385 //******************************************************************************
21386 /* Function:
21387  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21388  Summary:
21389  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21390  Ports module.
21391  Description:
21392  This function identifies whether the ChangeNoticePullDownPerPort feature is
21393  available on the Ports module.
21394  When this function returns true, these functions are supported on the device:
21395  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21396  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21397  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21398  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21399  Preconditions:
21400  None.
21401  Parameters:
21402  index - Identifier for the device instance
21403  Returns:
21404  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21405  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21406  Remarks:
21407  None.
21408 */
21409 
21410 bool
21412  PORTS_MODULE_ID index ) ;
21413 //******************************************************************************
21414 /* Function:
21415  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21416  Summary:
21417  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21418  module.
21419  Description:
21420  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21421  on the Ports module.
21422  When this function returns true, these functions are supported on the device:
21423  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21424  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21425  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21426  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21427  Preconditions:
21428  None.
21429  Parameters:
21430  index - Identifier for the device instance
21431  Returns:
21432  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21433  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21434  Remarks:
21435  None.
21436 */
21437 
21438 bool
21440  PORTS_MODULE_ID index ) ;
21441 //******************************************************************************
21442 /* Function:
21443  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21444  Summary:
21445  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21446  module.
21447  Description:
21448  This function identifies whether the PinChangeNoticePerPort feature is
21449  available on the Ports module.
21450  When this function returns true, these functions are supported on the device:
21451  - PLIB_PORTS_PinChangeNoticePerPortEnable
21452  - PLIB_PORTS_PinChangeNoticePerPortDisable
21453  - PLIB_PORTS_ChannelChangeNoticeEnable
21454  - PLIB_PORTS_ChannelChangeNoticeDisable
21455  Preconditions:
21456  None.
21457  Parameters:
21458  index - Identifier for the device instance
21459  Returns:
21460  - true - The PinChangeNoticePerPort feature is supported on the device
21461  - false - The PinChangeNoticePerPort feature is not supported on the device
21462  Remarks:
21463  None.
21464 */
21465 
21466 bool
21468  PORTS_MODULE_ID index ) ;
21469 //******************************************************************************
21470 /* Function:
21471  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21472  Summary:
21473  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21474  module.
21475  Description:
21476  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21477  available on the Ports module.
21478  When this function returns true, these functions are supported on the device:
21479  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21480  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21481  Preconditions:
21482  None.
21483  Parameters:
21484  index - Identifier for the device instance
21485  Returns:
21486  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21487  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21488  Remarks:
21489  None.
21490 */
21491 
21492 bool
21494  PORTS_MODULE_ID index ) ;
21495 //******************************************************************************
21496 /* Function:
21497  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21498  Summary:
21499  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21500  module.
21501  Description:
21502  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21503  available on the Ports module.
21504  When this function returns true, these functions are supported on the device:
21505  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21506  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21507  Preconditions:
21508  None.
21509  Parameters:
21510  index - Identifier for the device instance
21511  Returns:
21512  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21513  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21514  Remarks:
21515  None.
21516 */
21517 
21518 bool
21520  PORTS_MODULE_ID index ) ;
21521 //******************************************************************************
21522 /* Function:
21523  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
21524  Summary:
21525  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
21526  module.
21527  Description:
21528  This function identifies whether the ChangeNoticePerPortStatus feature is
21529  available on the Ports module.
21530  When this function returns true, these functions are supported on the device:
21531  - PLIB_PORTS_ChangeNoticePerPortHasOccured
21532  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
21533  Preconditions:
21534  None.
21535  Parameters:
21536  index - Identifier for the device instance
21537  Returns:
21538  - true - The ChangeNoticePerPortStatus feature is supported on the device
21539  - false - The ChangeNoticePerPortStatus feature is not supported on the device
21540  Remarks:
21541  None.
21542 */
21543 
21544 bool
21546  PORTS_MODULE_ID index ) ;
21547 //******************************************************************************
21548 /* Function:
21549  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
21550  Summary:
21551  Identifies whether the SlewRateControl feature exists on the Ports module.
21552  Description:
21553  This function identifies whether the SlewRateControl feature is available
21554  on the Ports module.
21555  When this function returns true, these functions are supported on the device:
21556  - PLIB_PORTS_ChannelSlewRateSelect
21557  - PLIB_PORTS_PinSlewRateGet
21558  Preconditions:
21559  None.
21560  Parameters:
21561  index - Identifier for the device instance
21562  Returns:
21563  - true - The SlewRateControl feature is supported on the device
21564  - false - The SlewRateControl feature is not supported on the device
21565  Remarks:
21566  None.
21567 */
21568 
21569 bool
21571  PORTS_MODULE_ID index ) ;
21572 //******************************************************************************
21573 /* Function:
21574  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
21575  Summary:
21576  Identifies whether the ChannelChangeNoticeMethod feature exists on the
21577  Ports module.
21578  Description:
21579  This function identifies whether the ChannelChangeNoticeMethod feature is
21580  available on the Ports module.
21581  When this function returns true, these functions are supported on the device:
21582  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
21583  - PLIB_PORTS_ChannelChangeNoticeMethodGet
21584  Preconditions:
21585  None.
21586  Parameters:
21587  index - Identifier for the device instance
21588  Returns:
21589  - true - The ChannelChangeNoticeMethod feature is supported on the device
21590  - false - The ChannelChangeNoticeMethod feature is not supported on the device
21591  Remarks:
21592  None.
21593 */
21594 
21595 bool
21597  PORTS_MODULE_ID index ) ;
21598 //******************************************************************************
21599 /* Function:
21600  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
21601  Summary:
21602  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
21603  module.
21604  Description:
21605  This function identifies whether the ChangeNoticeEdgeControl feature is
21606  available on the Ports module.
21607  When this function returns true, these functions are supported on the device:
21608  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21609  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21610  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21611  Preconditions:
21612  None.
21613  Parameters:
21614  index - Identifier for the device instance
21615  Returns:
21616  - true - The ChangeNoticeEdgeControl feature is supported on the device
21617  - false - The ChangeNoticeEdgeControl feature is not supported on the device
21618  Remarks:
21619  None.
21620 */
21621 
21622 bool
21624  PORTS_MODULE_ID index ) ;
21625 //******************************************************************************
21626 /* Function:
21627  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
21628  Summary:
21629  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
21630  module.
21631  Description:
21632  This function identifies whether the ChangeNoticeEdgeStatus feature is available
21633  on the Ports module.
21634  When this function returns true, this function is supported on the device:
21635  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21636  Preconditions:
21637  None.
21638  Parameters:
21639  index - Identifier for the device instance
21640  Returns:
21641  - true - The ChangeNoticeEdgeStatus feature is supported on the device
21642  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
21643  Remarks:
21644  None.
21645 */
21646 
21647 bool
21649  PORTS_MODULE_ID index ) ;
21650 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
21651 /*******************************************************************************
21652  Ports Peripheral Library Compatibility Header
21653  Company:
21654  Microchip Technology Inc.
21655  File Name:
21656  plib_ports_compatibility.h
21657  Summary:
21658  Ports Peripheral Library Interface header for backward compatibility.
21659  Description:
21660  This header file contains the definitions of the functions which are
21661  supported for backward compatibility only. These will be deprecated later.
21662 *******************************************************************************/
21663 // DOM-IGNORE-BEGIN
21664 /*******************************************************************************
21665 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
21666 Microchip licenses to you the right to use, modify, copy and distribute
21667 Software only when embedded on a Microchip microcontroller or digital signal
21668 controller that is integrated into your product or third party product
21669 (pursuant to the sublicense terms in the accompanying license agreement).
21670 You should refer to the license agreement accompanying this Software for
21671 additional information regarding your rights and obligations.
21672 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
21673 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
21674 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
21675 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
21676 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
21677 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
21678 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
21679 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
21680 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
21681 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
21682 *******************************************************************************/
21683 // DOM-IGNORE-END
21684 #ifndef _PLIB_PORTS_COMPATIBILITY_H
21685 #define _PLIB_PORTS_COMPATIBILITY_H
21686 #include <stdint.h>
21687 #include <stddef.h>
21688 // *****************************************************************************
21689 /* Function:
21690  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
21691  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
21692  Summary:
21693  checks the status of change on the pin
21694  Description:
21695  This function checks if the change has occurred on the given pin or not.
21696  Precondition:
21697  None.
21698  Parameters:
21699  index - Identifier for the device instance to be configured
21700  channel - Port pin channel
21701  bitPos - Position in the PORT pins
21702  Returns:
21703  None.
21704  Example:
21705  <code>
21706 
21707  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
21708  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
21709  {
21710  //do something
21711  }
21712 
21713  </code>
21714  Remarks:
21715  This feature may not be available on all devices. Please refer to the
21716  specific device data sheet to determine availability or use
21717  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
21718  whether this feature is available.
21719 
21720  This function will be deprecated later.
21721 */
21722 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
21723  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
21724 /*******************************************************************************
21725  End of File
21726 */
21727 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
21728 /* CLOSE_FILE Include File */
21729 
21730 //DOM-IGNORE-BEGIN
21731 //DOM-IGNORE-END
21732  // #ifndef _PLIB_PORTS_H
21733 /*******************************************************************************
21734  End of File
21735 */
21736 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
21737 /* CLOSE_FILE Include File */
21738 
21739 #include "system/int/sys_int.h"
21740 // *****************************************************************************
21741 // *****************************************************************************
21742 // Section: SYS PORTS Data Types
21743 // *****************************************************************************
21744 // *****************************************************************************
21745 // *****************************************************************************
21746 /* SYS PORTS PULLUP status
21747  Summary:
21748  Provides the pull-up and pull-down status.
21749  Description:
21750  These constants provide the pull-up or pull-down status definitions.
21751  Remarks:
21752  None.
21753 */
21754 
21755 typedef
21756  enum
21757  {
21758  /* PULLUP Disable */
21760  /*DOM-IGNORE-BEGIN*/
21761  = 0 /*DOM-IGNORE-END*/
21762  ,
21763  /* PULLUP Enable */
21765  /*DOM-IGNORE-BEGIN*/
21766  = 1 /*DOM-IGNORE-END*/
21767  ,
21769 // *****************************************************************************
21770 /* SYS PORTS PIN DIRECTION
21771  Summary:
21772  Defines the direction of the port pins.
21773  Description:
21774  These constants provide the port pin direction definitions.
21775  Remarks:
21776  None.
21777 */
21778 
21779 typedef
21780  enum
21781  {
21782  /* Direction as output */
21784  /*DOM-IGNORE-BEGIN*/
21785  = 0 /*DOM-IGNORE-END*/
21786  ,
21787  /* Direction as input */
21789  /*DOM-IGNORE-BEGIN*/
21790  = 1 /*DOM-IGNORE-END*/
21791  ,
21793 
21794 typedef
21795  enum
21796  {
21799  // #ifndef _SYS_PORTS_DEFINITIONS_H
21800 /*******************************************************************************
21801  End of File
21802 */
21803 
21804 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
21805 /* CLOSE_FILE Include File */
21806 
21807 // DOM-IGNORE-BEGIN
21808 // DOM-IGNORE-END
21809 // *****************************************************************************
21810 // *****************************************************************************
21811 // Section: SYS PorTS Module Initialization Routine
21812 // *****************************************************************************
21813 // *****************************************************************************
21814 // *****************************************************************************
21815 /* Function:
21816  void SYS_PORTS_Initialize()
21817  Summary:
21818  Initializes PORT Pins/Channels.
21819  <p><b>Implementation:</b> Static/Dynamic</p>
21820  Description:
21821  This function initializes different port pins/channels to the desired state.
21822  It also remaps the pins to the desired specific function.
21823  Precondition:
21824  None.
21825  Parameters:
21826  None.
21827  Returns:
21828  None.
21829  Example:
21830  <code>
21831  SYS_PORTS_Initialize();
21832  </code>
21833  Remarks:
21834  This API must be be called at the time of system initialization to
21835  initialize the ports pins.
21836 */
21837 
21838 void
21840 // *****************************************************************************
21841 // *****************************************************************************
21842 // Section: SYS PORTS CONTROL Routines
21843 // *****************************************************************************
21844 // *****************************************************************************
21845 // *****************************************************************************
21846 /* Function:
21847  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21848  Summary:
21849  Reads the data from the I/O port.
21850  <p><b>Implementation:</b> Dynamic</p>
21851  Description:
21852  This function reads the data from the I/O port.
21853  Preconditions:
21854  The direction of the port to be set as input.
21855  Parameters:
21856  index - Identifier for the device instance to be configured
21857  channel - Identifier for the PORT channel: A, B, C, etc.
21858  Returns:
21859  Returns the data read from the port.
21860  Example:
21861  <code>
21862  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21863  // application developer.
21864  PORTS_DATA_TYPE readData;
21865  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
21866  </code>
21867  Remarks:
21868  None.
21869 */
21870 
21872  SYS_PORTS_Read (
21873  PORTS_MODULE_ID index ,
21874  PORTS_CHANNEL channel ) ;
21875 // *****************************************************************************
21876 /* Function:
21877  void SYS_PORTS_Write( PORTS_MODULE_ID index,
21878  PORTS_CHANNEL channel,
21879  PORTS_DATA_TYPE value )
21880  Summary:
21881  Writes the data to the I/O port.
21882  <p><b>Implementation:</b> Dynamic</p>
21883  Description:
21884  This function writes the data to the I/O port.
21885  Preconditions:
21886  The direction of the port to be set as output.
21887  Parameters:
21888  index - Identifier for the device instance to be configured
21889  channel - Identifier for the PORT channel: A, B, C, etc.
21890  value - Value to be written into a port of width PORTS_DATA_TYPE
21891  Returns:
21892  None.
21893  Example:
21894  <code>
21895  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21896  // application developer.
21897  PORTS_DATA_TYPE writeData;
21898  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
21899  </code>
21900  Remarks:
21901  None.
21902 */
21903 
21904 void
21905  SYS_PORTS_Write (
21906  PORTS_MODULE_ID index ,
21907  PORTS_CHANNEL channel ,
21908  PORTS_DATA_TYPE value ) ;
21909 // *****************************************************************************
21910 /* Function:
21911  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21912  Summary:
21913  Reads the data driven on the I/O port.
21914  <p><b>Implementation:</b> Dynamic</p>
21915  Description:
21916  This function reads the data driven on the I/O port.
21917  Preconditions:
21918  The direction of the port to be set as output.
21919  Parameters:
21920  index - Identifier for the device instance to be configured
21921  channel - Identifier for the PORT channel: A, B, C, etc.
21922  Returns:
21923  Returns the data driven on the port.
21924  Example:
21925  <code>
21926  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21927  // application developer.
21928  PORTS_DATA_TYPE drivenData;
21929  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
21930  </code>
21931  Remarks:
21932  None.
21933 */
21934 
21937  PORTS_MODULE_ID index ,
21938  PORTS_CHANNEL channel ) ;
21939 // *****************************************************************************
21940 /* Function:
21941  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
21942  PORTS_DATA_TYPE value,
21943  PORTS_DATA_MASK mask )
21944  Summary:
21945  Sets the selected digital port/latch based on the mask.
21946  <p><b>Implementation:</b> Dynamic</p>
21947  Description:
21948  This function Sets the selected digital port/latch relative to the mask.
21949  This function "AND" value and mask parameters and then set the bits
21950  in the port channel that were set in the result of the ANDing operation.
21951  Preconditions:
21952  None.
21953  Parameters:
21954  index - Identifier for the device instance to be configured
21955  channel - Identifier for the PORT channel: A, B, C, etc.
21956  value - Consists of information about which port bit has to be set
21957  mask - Identifies the bits which could be intended for setting
21958  Returns:
21959  None.
21960  Example:
21961  <code>
21962  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21963  // application developer.
21964  // MY_VALUE - 0x1234
21965  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
21966  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
21967  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
21968  </code>
21969  Remarks:
21970  Not all features are available on all devices. Refer to the specific device
21971  data sheet for availability.
21972 */
21973 
21974 void
21975  SYS_PORTS_Set (
21976  PORTS_MODULE_ID index ,
21977  PORTS_CHANNEL channel ,
21978  PORTS_DATA_TYPE value ,
21979  PORTS_DATA_MASK mask ) ;
21980 // *****************************************************************************
21981 /* Function:
21982  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
21983  PORTS_DATA_MASK clearMask )
21984  Summary:
21985  Clears the selected digital port.
21986  <p><b>Implementation:</b> Dynamic</p>
21987  Description:
21988  This function clears the selected digital port.
21989  Preconditions:
21990  None.
21991  Parameters:
21992  index - Identifier for the device instance to be configured
21993  channel - Identifier for the PORT channel: A, B, C, etc.
21994  clearMask - Identifies the bits to be cleared
21995  Returns:
21996  None.
21997  Example:
21998  <code>
21999  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22000  // application developer.
22001  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22002  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22003  </code>
22004  Remarks:
22005  Not all features are available on all devices. Refer to the specific device
22006  data sheet for availability.
22007 */
22008 
22009 void
22010  SYS_PORTS_Clear (
22011  PORTS_MODULE_ID index ,
22012  PORTS_CHANNEL channel ,
22013  PORTS_DATA_MASK clearMask ) ;
22014 // *****************************************************************************
22015 /* Function:
22016  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22017  SYS_PORTS_PIN_DIRECTION pinDir,
22018  PORTS_CHANNEL channel,
22019  PORTS_DATA_MASK mask )
22020  Summary:
22021  Enables the direction for the selected port.
22022  <p><b>Implementation:</b> Dynamic</p>
22023  Description:
22024  This function enables the direction for the selected port.
22025  Preconditions:
22026  None.
22027  Parameters:
22028  index - Identifier for the device instance to be configured
22029  pinDir - Pin direction
22030  channel - Identifier for the PORT channel: A, B, C, etc.
22031  mask - Mask for the direction of width PORTS_DATA_MASK
22032  Returns:
22033  None
22034  Example:
22035  <code>
22036  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22037  // application developer.
22038  SYS_PORTS_PIN_DIRECTION pinDir;
22039  pinDir = SYS_PORTS_DIRECTION_INPUT;
22040  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22041  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22042  </code>
22043  Remarks:
22044  None.
22045 */
22046 
22047 void
22049  PORTS_MODULE_ID index ,
22050  SYS_PORTS_PIN_DIRECTION pinDir ,
22051  PORTS_CHANNEL channel ,
22052  PORTS_DATA_MASK mask ) ;
22053 // *****************************************************************************
22054 /* Function:
22055  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22056  Summary:
22057  Reads the direction for the selected port.
22058  <p><b>Implementation:</b> Dynamic</p>
22059  Description:
22060  This function reads the direction for the selected port.
22061  Preconditions:
22062  None.
22063  Parameters:
22064  index - Identifier for the device instance to be configured
22065  channel - Identifier for the PORT channel: A, B, C, etc.
22066  Returns:
22067  Direction of the port.
22068  Example:
22069  <code>
22070  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22071  // application developer.
22072  PORTS_DATA_MASK value;
22073  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22074  </code>
22075  Remarks:
22076  None.
22077 */
22078 
22081  PORTS_MODULE_ID index ,
22082  PORTS_CHANNEL channel ) ;
22083 // *****************************************************************************
22084 /* Function:
22085  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22086  PORTS_DATA_MASK toggleMask )
22087  Summary:
22088  Toggles the selected digital port pins.
22089  <p><b>Implementation:</b> Dynamic</p>
22090  Description:
22091  This function toggles the selected digital port pins.
22092  Preconditions:
22093  None.
22094  Parameters:
22095  index - Identifier for the device instance to be configured
22096  channel - Identifier for the PORT channel: A, B, C, etc.
22097  toggleMask - Identifies the bits to be toggled
22098  Returns:
22099  None.
22100  Example:
22101  <code>
22102  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22103  // application developer.
22104  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22105  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22106  </code>
22107  Remarks:
22108  None.
22109 */
22110 
22111 void
22113  PORTS_MODULE_ID index ,
22114  PORTS_CHANNEL channel ,
22115  PORTS_DATA_MASK toggleMask ) ;
22116 // *****************************************************************************
22117 /* Function:
22118  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22119  PORTS_DATA_MASK mask )
22120  Summary:
22121  Enables the open-drain functionality for the selected port.
22122  <p><b>Implementation:</b> Dynamic</p>
22123  Description:
22124  This function enables the open-drain functionality for the selected port.
22125  Preconditions:
22126  None.
22127  Parameters:
22128  index - Identifier for the device instance to be configured
22129  channel - Identifier for the PORT channel: A, B, C, etc.
22130  mask - Mask of type PORTS_DATA_MASK
22131  Returns:
22132  None.
22133  Example:
22134  <code>
22135  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22136  // application developer.
22137  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22138  </code>
22139  Remarks:
22140  Not all features are available on all devices. Refer to the specific device
22141  data sheet for availability.
22142 */
22143 
22144 void
22146  PORTS_MODULE_ID index ,
22147  PORTS_CHANNEL channel ,
22148  PORTS_DATA_MASK mask ) ;
22149 // *****************************************************************************
22150 /* Function:
22151  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22152  PORTS_DATA_MASK mask )
22153  Summary:
22154  Disables the open-drain functionality for the selected port.
22155  <p><b>Implementation:</b> Dynamic</p>
22156  Description:
22157  This function disables the open-drain functionality for the selected port.
22158  Preconditions:
22159  None.
22160  Parameters:
22161  index - Identifier for the device instance to be configured
22162  channel - Identifier for the PORT channel: A, B, C, etc.
22163  mask - Mask of type PORTS_DATA_MASK
22164  Returns:
22165  None.
22166  Example:
22167  <code>
22168  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22169  // application developer.
22170  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22171  </code>
22172  Remarks:
22173  Not all features are available on all devices. Refer to the specific device
22174  data sheet for availability.
22175 */
22176 
22177 void
22179  PORTS_MODULE_ID index ,
22180  PORTS_CHANNEL channel ,
22181  PORTS_DATA_MASK mask ) ;
22182 // *****************************************************************************
22183 /* Function:
22184  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22185  (
22186  PORTS_MODULE_ID index,
22187  PORTS_CHANNEL channel
22188  )
22189  Summary:
22190  Reads the interrupt status from the I/O port.
22191  <p><b>Implementation:</b> Dynamic</p>
22192  Description:
22193  This function reads the interrupt status from the I/O port.
22194  Preconditions:
22195  The interrupts should have been configured.
22196  Parameters:
22197  index - Identifier for the device instance to be configured
22198  channel - Identifier for the PORT channel: A, B, C, etc.
22199  Returns:
22200  Returns the interrupt status of the port channel.
22201  Example:
22202  <code>
22203  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22204  // application developer.
22205  PORTS_DATA_TYPE channelStatus;
22206  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22207  </code>
22208  Remarks:
22209  None.
22210 */
22211 
22214  PORTS_MODULE_ID index ,
22215  PORTS_CHANNEL channel ) ;
22216 // *****************************************************************************
22217 // *****************************************************************************
22218 // Section: SYS PORT PINS REMAPING Routines
22219 // *****************************************************************************
22220 // *****************************************************************************
22221 // *****************************************************************************
22222 /* Function:
22223  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22224  PORTS_REMAP_INPUT_FUNCTION function,
22225  PORTS_REMAP_INPUT_PIN remapPin )
22226  Summary:
22227  Input/Output (I/O) function remapping.
22228  <p><b>Implementation:</b> Dynamic</p>
22229  Description:
22230  This function controls the I/O function remapping.
22231  Precondition:
22232  None.
22233  Parameters:
22234  index - Identifier for the device instance to be configured
22235  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22236  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22237  Returns:
22238  None.
22239  Example:
22240  <code>
22241  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22242  // application developer.
22243  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22244  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22245  </code>
22246  Remarks:
22247  This feature may not be available on all devices. Please refer to the
22248  specific device data sheet to determine availability or use
22249  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22250  this feature is available.
22251 */
22252 
22253 void
22255  PORTS_MODULE_ID index ,
22256  PORTS_REMAP_INPUT_FUNCTION function ,
22257  PORTS_REMAP_INPUT_PIN remapPin ) ;
22258 // *****************************************************************************
22259 /* Function:
22260  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22261  PORTS_REMAP_OUTPUT_FUNCTION function,
22262  PORTS_REMAP_OUTPUT_PIN remapPin )
22263  Summary:
22264  Input/Output (I/O) function remapping.
22265  <p><b>Implementation:</b> Dynamic</p>
22266  Description:
22267  This function controls the I/O function remapping.
22268  Precondition:
22269  None.
22270  Parameters:
22271  index - Identifier for the device instance to be configured
22272  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22273  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22274  Returns:
22275  None.
22276  Example:
22277  <code>
22278  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22279  // application developer.
22280  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22281  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22282  </code>
22283  Remarks:
22284  This feature may not be available on all devices. Please refer to the
22285  specific device data sheet to determine availability or use
22286  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22287  this feature is available.
22288 */
22289 
22290 void
22292  PORTS_MODULE_ID index ,
22293  PORTS_REMAP_OUTPUT_FUNCTION function ,
22294  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22295 // *****************************************************************************
22296 // *****************************************************************************
22297 // Section: SYS Change Notification Pins Routines
22298 // *****************************************************************************
22299 // *****************************************************************************
22300 // *****************************************************************************
22301 /* Function:
22302  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22303  Summary:
22304  Globally enables the change notification for the selected port.
22305  <p><b>Implementation:</b> Dynamic</p>
22306  Description:
22307  This function globally enables the change notification for the selected port.
22308  Preconditions:
22309  None.
22310  Parameters:
22311  None.
22312  Returns:
22313  None.
22314  Example:
22315  <code>
22316  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22317  // application developer.
22318  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22319  </code>
22320  Remarks:
22321  Not all features are available on all devices. Refer to the specific device
22322  data sheet for availability.
22323 */
22324 
22325 void
22327  PORTS_MODULE_ID index ) ;
22328 // *****************************************************************************
22329 /* Function:
22330  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22331  Summary:
22332  Globally disables the change notification for the selected port.
22333  <p><b>Implementation:</b> Dynamic</p>
22334  Description:
22335  This function globally disables the change notification for the selected port.
22336  Preconditions:
22337  None.
22338  Parameters:
22339  None.
22340  Returns:
22341  None.
22342  Example:
22343  <code>
22344  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22345  // application developer.
22346  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22347  </code>
22348  Remarks:
22349  Not all features are available on all devices. Refer to the specific device
22350  data sheet for availability.
22351 */
22352 
22353 void
22355  PORTS_MODULE_ID index ) ;
22356 // *****************************************************************************
22357 /* Function:
22358  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22359  PORTS_CHANGE_NOTICE_PIN pinNum,
22360  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22361  Summary:
22362  Enables the change notification for the selected port.
22363  <p><b>Implementation:</b> Dynamic</p>
22364  Description:
22365  This function enables the change notification for the selected port.
22366  Preconditions:
22367  None.
22368  Parameters:
22369  index - Identifier for the device instance to be configured
22370  value - Pull-up enable or disable value
22371  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22372  Returns:
22373  None.
22374  Example:
22375  <code>
22376  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22377  // application developer.
22378  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22379  PORTS_CHANGE_NOTICE_PIN pinNum;
22380  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22381  </code>
22382  Remarks:
22383  Not all features are available on all devices. Refer to the specific device
22384  data sheet for availability.
22385 */
22386 
22387 void
22389  PORTS_MODULE_ID index ,
22390  PORTS_CHANGE_NOTICE_PIN pinNum ,
22392 // *****************************************************************************
22393 /* Function:
22394  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22395  PORTS_CHANGE_NOTICE_PIN pinNum )
22396  Summary:
22397  Disables the change notification for the selected port.
22398  <p><b>Implementation:</b> Dynamic</p>
22399  Description:
22400  This function disables the change notification for the selected port.
22401  Preconditions:
22402  None.
22403  Parameters:
22404  index - Identifier for the device instance to be configured
22405  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22406  Returns:
22407  None.
22408  Example:
22409  <code>
22410  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22411  // application developer.
22412  PORTS_CHANGE_NOTICE_PIN pinNum;
22413  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22414  </code>
22415  Remarks:
22416  Not all features are available on all devices. Refer to the specific device
22417  data sheet for availability.
22418 */
22419 
22420 void
22422  PORTS_MODULE_ID index ,
22423  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22424 // *****************************************************************************
22425 /* Function:
22426  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22427  Summary:
22428  Enables the change notification for the selected port in Sleep or Idle mode.
22429  <p><b>Implementation:</b> Dynamic</p>
22430  Description:
22431  This function enables the change notification for the selected port in Sleep
22432  or Idle mode.
22433  Preconditions:
22434  None.
22435  Parameters:
22436  None.
22437  Returns:
22438  None.
22439  Example:
22440  <code>
22441  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22442  // application developer.
22443  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22444  </code>
22445  Remarks:
22446  Not all features are available on all devices. Refer to the specific device
22447  data sheet for availability.
22448 */
22449 
22450 void
22452  PORTS_MODULE_ID index ) ;
22453 // *****************************************************************************
22454 /* Function:
22455  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22456  Summary:
22457  Disables the change notification for the selected port in Sleep or Idle mode.
22458  <p><b>Implementation:</b> Dynamic</p>
22459  Description:
22460  This function disables the change notification for the selected port in Sleep
22461  or Idle mode.
22462  Preconditions:
22463  None.
22464  Parameters:
22465  None.
22466  Returns:
22467  None.
22468  Example:
22469  <code>
22470  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22471  // application developer.
22472  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22473  </code>
22474  Remarks:
22475  Not all features are available on all devices. Refer to the specific device
22476  data sheet for availability.
22477 */
22478 
22479 void
22481  PORTS_MODULE_ID index ) ;
22482 // *****************************************************************************
22483 /* Function:
22484  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22485  PORTS_CHANGE_NOTICE_PIN pinNum )
22486  Summary:
22487  Enables a weak pull-up on the change notification pin.
22488  <p><b>Implementation:</b> Dynamic</p>
22489  Description:
22490  This function enables a weak pull-up on the change notification pin.
22491  Preconditions:
22492  None.
22493  Parameters:
22494  index - Identifier for the device instance to be configured
22495  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22496  Returns:
22497  None.
22498  Example:
22499  <code>
22500  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22501  // application developer.
22502  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22503  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22504  </code>
22505  Remarks:
22506  Not all features are available on all devices. Refer to the specific device
22507  data sheet for availability.
22508 */
22509 
22510 void
22512  PORTS_MODULE_ID index ,
22513  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22514 // *****************************************************************************
22515 /* Function:
22516  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22517  PORTS_CHANGE_NOTICE_PIN pinNum )
22518  Summary:
22519  Disables a weak pull-up on the change notification pin.
22520  <p><b>Implementation:</b> Dynamic</p>
22521  Description:
22522  This function Disables a weak pull-up on the change notification pin.
22523  Preconditions:
22524  None.
22525  Parameters:
22526  index - Identifier for the device instance to be configured
22527  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22528  Returns:
22529  None.
22530  Example:
22531  <code>
22532  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22533  // application developer.
22534  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22535  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
22536  </code>
22537  Remarks:
22538  Not all features are available on all devices. Refer to the specific device
22539  data sheet for availability.
22540 */
22541 
22542 void
22544  PORTS_MODULE_ID index ,
22545  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22546 // *****************************************************************************
22547 // *****************************************************************************
22548 // Section: SYS PORT PINS Control Routines
22549 // *****************************************************************************
22550 // *****************************************************************************
22551 // *****************************************************************************
22552 /* Function:
22553  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
22554  PORTS_ANALOG_PIN pin,
22555  PORTS_PIN_MODE mode)
22556  Summary:
22557  Enables the selected pin as analog or digital.
22558  <p><b>Implementation:</b> Dynamic</p>
22559  Description:
22560  This function enables the selected pin as analog or digital.
22561  Preconditions:
22562  None.
22563  Parameters:
22564  index - Identifier for the device instance to be configured
22565  pin - Possible values of PORTS_ANALOG_PIN
22566  mode - Possible values of PORTS_PIN_MODE
22567  Returns:
22568  None.
22569  Example:
22570  <code>
22571  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22572  // application developer.
22573  // MY_PIN - PORTS_ANALOG_PIN_AN0
22574  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
22575  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
22576  </code>
22577  Remarks:
22578  Not all features are available on all devices. Refer to the specific device
22579  data sheet for availability.
22580 */
22581 
22582 void
22584  PORTS_MODULE_ID index ,
22585  PORTS_ANALOG_PIN pin ,
22586  PORTS_PIN_MODE mode ) ;
22587 // *****************************************************************************
22588 /* Function:
22589  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
22590  PORTS_CHANNEL channel,
22591  PORTS_BIT_POS bitPos
22592  bool value )
22593  Summary:
22594  Writes the selected digital pin.
22595  <p><b>Implementation:</b> Dynamic</p>
22596  Description:
22597  This function writes the selected digital pin.
22598  Preconditions:
22599  None.
22600  Parameters:
22601  index - Identifier for the device instance to be configured
22602  channel - Identifier for the PORT channel: A, B, C, etc.
22603  bitPos - Possible values of PORTS_BIT_POS
22604  value - Value to be written to the specific pin/latch:
22605  - true - Sets the bit
22606  - false - Clears the bit
22607  Returns:
22608  None.
22609  Example:
22610  <code>
22611  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22612  // application developer.
22613  // MY_PINNUM - PORTS_PIN_10
22614  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
22615  </code>
22616  Remarks:
22617  Not all features are available on all devices. Refer to the specific device
22618  data sheet for availability.
22619 */
22620 
22621 void
22623  PORTS_MODULE_ID index ,
22624  PORTS_CHANNEL channel ,
22625  PORTS_BIT_POS bitPos ,
22626  bool value ) ;
22627 // *****************************************************************************
22628 /* Function:
22629  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
22630  PORTS_CHANNEL channel,
22631  PORTS_BIT_POS bitPos )
22632  Summary:
22633  Reads the data driven on the selected digital pin.
22634  <p><b>Implementation:</b> Dynamic</p>
22635  Description:
22636  This function reads the data driven on the selected
22637  digital output pin.
22638  Preconditions:
22639  None.
22640  Parameters:
22641  index - Identifier for the device instance to be configured
22642  channel - Identifier for the PORT channel: A, B, C, etc.
22643  bitPos - Possible values of PORTS_BIT_POS
22644  Returns:
22645  The status of the data driven on the port pin.
22646  Example:
22647  <code>
22648  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22649  // application developer.
22650  // MY_PINNUM - PORTS_PIN_10
22651  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22652  </code>
22653  Remarks:
22654  Not all features are available on all devices. Refer to the specific device
22655  data sheet for availability.
22656 */
22657 
22658 bool
22660  PORTS_MODULE_ID index ,
22661  PORTS_CHANNEL channel ,
22662  PORTS_BIT_POS bitPos ) ;
22663 // *****************************************************************************
22664 /* Function:
22665  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
22666  PORTS_CHANNEL channel,
22667  PORTS_BIT_POS bitPos )
22668  Summary:
22669  Reads the selected digital pin.
22670  <p><b>Implementation:</b> Dynamic</p>
22671  Description:
22672  This function reads the selected digital pin, not the Latch.
22673  Preconditions:
22674  None.
22675  Parameters:
22676  index - Identifier for the device instance to be configured
22677  channel - Identifier for the PORT channel: A, B, C, etc.
22678  bitPos - Possible values of PORTS_BIT_POS
22679  Returns:
22680  The status of the port pin.
22681  Example:
22682  <code>
22683  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22684  // application developer.
22685  // MY_PINNUM - PORTS_PIN_10
22686  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22687  </code>
22688  Remarks:
22689  Not all features are available on all devices. Refer to the specific device
22690  data sheet for availability.
22691 */
22692 
22693 bool
22695  PORTS_MODULE_ID index ,
22696  PORTS_CHANNEL channel ,
22697  PORTS_BIT_POS bitPos ) ;
22698 // *****************************************************************************
22699 /* Function:
22700  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
22701  PORTS_CHANNEL channel,
22702  PORTS_BIT_POS bitPos )
22703  Summary:
22704  Toggles the selected digital pin.
22705  <p><b>Implementation:</b> Dynamic</p>
22706  Description:
22707  This function toggles the selected digital pin.
22708  Preconditions:
22709  None.
22710  Parameters:
22711  index - Identifier for the device instance to be configured
22712  channel - Identifier for the PORT channel: A, B, C, etc.
22713  bitPos - Possible values of PORTS_BIT_POS
22714  Returns:
22715  None.
22716  Example:
22717  <code>
22718  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22719  // application developer.
22720  // MY_PINNUM - PORTS_PIN_10
22721  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22722  </code>
22723  Remarks:
22724  Not all features are available on all devices. Refer to the specific device
22725  data sheet for availability.
22726 */
22727 
22728 void
22730  PORTS_MODULE_ID index ,
22731  PORTS_CHANNEL channel ,
22732  PORTS_BIT_POS bitPos ) ;
22733 // *****************************************************************************
22734 /* Function:
22735  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
22736  PORTS_CHANNEL channel,
22737  PORTS_BIT_POS bitPos )
22738  Summary:
22739  Sets the selected digital pin/latch.
22740  <p><b>Implementation:</b> Dynamic</p>
22741  Description:
22742  This function sets the selected digital pin/latch.
22743  Preconditions:
22744  None.
22745  Parameters:
22746  index - Identifier for the device instance to be configured
22747  channel - Identifier for the PORT channel: A, B, C, etc.
22748  bitPos - Possible values of PORTS_BIT_POS
22749  Returns:
22750  None.
22751  Example:
22752  <code>
22753  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22754  // application developer.
22755  // MY_PINNUM - PORTS_PIN_10
22756  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22757  </code>
22758  Remarks:
22759  Not all features are available on all devices. Refer to the specific device
22760  data sheet for availability.
22761 */
22762 
22763 void
22765  PORTS_MODULE_ID index ,
22766  PORTS_CHANNEL channel ,
22767  PORTS_BIT_POS bitPos ) ;
22768 // *****************************************************************************
22769 /* Function:
22770  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
22771  PORTS_CHANNEL channel,
22772  PORTS_BIT_POS bitPos )
22773  Summary:
22774  Clears the selected digital pin.
22775  <p><b>Implementation:</b> Dynamic</p>
22776  Description:
22777  This function clears the selected digital pin.
22778  Preconditions:
22779  None.
22780  Parameters:
22781  index - Identifier for the device instance to be configured
22782  channel - Identifier for the PORT channel: A, B, C, etc.
22783  bitPos - Possible values of PORTS_BIT_POS
22784  Returns:
22785  None.
22786  Example:
22787  <code>
22788  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22789  // application developer.
22790  // MY_PINNUM - PORTS_IO_PIN_10
22791  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22792  </code>
22793  Remarks:
22794  Not all features are available on all devices. Refer to the specific device
22795  data sheet for availability.
22796 */
22797 
22798 void
22800  PORTS_MODULE_ID index ,
22801  PORTS_CHANNEL channel ,
22802  PORTS_BIT_POS bitPos ) ;
22803 // *****************************************************************************
22804 /* Function:
22805  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
22806  SYS_PORTS_PIN_DIRECTION pinDir,
22807  PORTS_CHANNEL channel,
22808  PORTS_BIT_POS bitPos )
22809  Summary:
22810  Enables the direction for the selected pin.
22811  <p><b>Implementation:</b> Dynamic</p>
22812  Description:
22813  This function enables the direction for the selected pin.
22814  Preconditions:
22815  None.
22816  Parameters:
22817  index - Identifier for the device instance to be configured
22818  pinDir - Pin direction
22819  channel - Identifier for the PORT channel: A, B, C, etc.
22820  bitPos - Possible values of PORTS_BIT_POS
22821  Returns:
22822  None.
22823  Example:
22824  <code>
22825  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22826  // application developer.
22827  // MY_PINNUM - PORTS_PIN_10
22828  SYS_PORTS_PIN_DIRECTION pinDir;
22829  pinDir = SYS_PORTS_DIRECTION_INPUT;
22830  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
22831  </code>
22832  Remarks:
22833  Not all features are available on all devices. Refer to the specific device
22834  data sheet for availability.
22835 */
22836 
22837 void
22839  PORTS_MODULE_ID index ,
22840  SYS_PORTS_PIN_DIRECTION pinDir ,
22841  PORTS_CHANNEL channel ,
22842  PORTS_BIT_POS bitPos ) ;
22843 // *****************************************************************************
22844 /* Function:
22845  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
22846  PORTS_CHANNEL channel,
22847  PORTS_BIT_POS bitPos )
22848  Summary:
22849  Enables the open-drain functionality for the selected pin.
22850  <p><b>Implementation:</b> Dynamic</p>
22851  Description:
22852  This function enables the open-drain functionality for the selected pin.
22853  Preconditions:
22854  None.
22855  Parameters:
22856  index - Identifier for the device instance to be configured
22857  channel - Identifier for the PORT channel: A, B, C, etc.
22858  bitPos - Possible values of PORTS_BIT_POS
22859  Returns:
22860  None.
22861  Example:
22862  <code>
22863  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22864  // application developer.
22865  // MY_PINNUM - PORTS_PIN_10
22866  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22867  </code>
22868  Remarks:
22869  Not all features are available on all devices. Refer to the specific device
22870  data sheet for availability.
22871 */
22872 
22873 void
22875  PORTS_MODULE_ID index ,
22876  PORTS_CHANNEL channel ,
22877  PORTS_BIT_POS bitPos ) ;
22878 // *****************************************************************************
22879 /* Function:
22880  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
22881  PORTS_CHANNEL channel,
22882  PORTS_BIT_POS bitPos )
22883  Summary:
22884  Disables the open-drain functionality for the selected pin.
22885  <p><b>Implementation:</b> Dynamic</p>
22886  Description:
22887  This function disables the open-drain functionality for the selected pin.
22888  Preconditions:
22889  None.
22890  Parameters:
22891  index - Identifier for the device instance to be configured
22892  channel - Identifier for the PORT channel: A, B, C, etc.
22893  bitPos - Possible values of PORTS_BIT_POS
22894  Returns:
22895  None.
22896  Example:
22897  <code>
22898  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22899  // application developer.
22900  // MY_PINNUM - PORTS_PIN_10
22901  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22902  </code>
22903  Remarks:
22904  Not all features are available on all devices. Refer to the specific device
22905  data sheet for availability.
22906 */
22907 
22908 void
22910  PORTS_MODULE_ID index ,
22911  PORTS_CHANNEL channel ,
22912  PORTS_BIT_POS bitPos ) ;
22913 // *****************************************************************************
22914 /* Function:
22915  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
22916  PORTS_CHANNEL channel,
22917  PORTS_BIT_POS bitPos )
22918  Summary:
22919  Enables the pull-up functionality for the selected pin.
22920  <p><b>Implementation:</b> Dynamic</p>
22921  Description:
22922  This function enables the pull-up functionality for the selected pin.
22923  Preconditions:
22924  None.
22925  Parameters:
22926  index - Identifier for the device instance to be configured
22927  channel - Identifier for the PORT channel: A, B, C, etc.
22928  bitPos - Possible values of PORTS_BIT_POS
22929  Returns:
22930  None.
22931  Example:
22932  <code>
22933  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22934  // application developer.
22935  // MY_PINNUM - PORTS_PIN_10
22936  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22937  </code>
22938  Remarks:
22939  Not all features are available on all devices. Refer to the specific device
22940  data sheet for availability.
22941 */
22942 
22943 void
22945  PORTS_MODULE_ID index ,
22946  PORTS_CHANNEL channel ,
22947  PORTS_BIT_POS bitPos ) ;
22948 // *****************************************************************************
22949 /* Function:
22950  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
22951  PORTS_CHANNEL channel,
22952  PORTS_BIT_POS bitPos )
22953  Summary:
22954  Disables the pull-up functionality for the selected pin.
22955  <p><b>Implementation:</b> Dynamic</p>
22956  Description:
22957  This function disables the pull-up functionality for the selected pin.
22958  Preconditions:
22959  None.
22960  Parameters:
22961  index - Identifier for the device instance to be configured
22962  channel - Identifier for the PORT channel: A, B, C, etc.
22963  bitPos - Possible values of PORTS_BIT_POS
22964  Returns:
22965  None.
22966  Example:
22967  <code>
22968  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22969  // application developer.
22970  // MY_PINNUM - PORTS_PIN_10
22971  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22972  </code>
22973  Remarks:
22974  Not all features are available on all devices. Refer to the specific device
22975  data sheet for availability.
22976 */
22977 
22978 void
22980  PORTS_MODULE_ID index ,
22981  PORTS_CHANNEL channel ,
22982  PORTS_BIT_POS bitPos ) ;
22983 // *****************************************************************************
22984 /* Function:
22985  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
22986  PORTS_CHANNEL channel,
22987  PORTS_BIT_POS bitPos )
22988  Summary:
22989  Enables the pull-down functionality for the selected pin.
22990  <p><b>Implementation:</b> Dynamic</p>
22991  Description:
22992  This function enables the pull-down functionality for the selected pin.
22993  Preconditions:
22994  None.
22995  Parameters:
22996  index - Identifier for the device instance to be configured
22997  channel - Identifier for the PORT channel: A, B, C, etc.
22998  bitPos - Possible values of PORTS_BIT_POS
22999  Returns:
23000  None.
23001  Example:
23002  <code>
23003  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23004  // application developer.
23005  // MY_PINNUM - PORTS_PIN_10
23006  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23007  </code>
23008  Remarks:
23009  Not all features are available on all devices. Refer to the specific device
23010  data sheet for availability.
23011 */
23012 
23013 void
23015  PORTS_MODULE_ID index ,
23016  PORTS_CHANNEL channel ,
23017  PORTS_BIT_POS bitPos ) ;
23018 // *****************************************************************************
23019 /* Function:
23020  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23021  PORTS_CHANNEL channel,
23022  PORTS_BIT_POS bitPos )
23023  Summary:
23024  Disables the pull-down functionality for the selected pin.
23025  <p><b>Implementation:</b> Dynamic</p>
23026  Description:
23027  This function disables the pull-down functionality for the selected pin.
23028  Preconditions:
23029  None.
23030  Parameters:
23031  index - Identifier for the device instance to be configured
23032  channel - Identifier for the PORT channel: A, B, C, etc.
23033  bitPos - Possible values of PORTS_BIT_POS
23034  Returns:
23035  None.
23036  Example:
23037  <code>
23038  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23039  // application developer.
23040  // MY_PINNUM - PORTS_PIN_10
23041  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23042  </code>
23043  Remarks:
23044  Not all features are available on all devices. Refer to the specific device
23045  data sheet for availability.
23046 */
23047 
23048 void
23050  PORTS_MODULE_ID index ,
23051  PORTS_CHANNEL channel ,
23052  PORTS_BIT_POS bitPos ) ;
23053 //******************************************************************************
23054 /* Function:
23055  void SYS_PORTS_InterruptEnable
23056  (
23057  PORTS_MODULE_ID index,
23058  PORTS_CHANNEL channel,
23059  PORTS_BIT_POS bitPos,
23060  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23061  )
23062  Summary:
23063  Enables the selected interrupt for the selected port pin.
23064  Description:
23065  This function enables the selected interrupt for the selected port pin.
23066  Preconditions:
23067  Select the pull-up or pull-down as required.
23068  Parameters:
23069  index - Identifier for the device instance to be configured
23070  channel - Identifier for the PORT channel: A, B, C, etc.
23071  bitPos - Possible values of PORTS_BIT_POS
23072  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23073  Returns:
23074  None.
23075  Example:
23076  <code>
23077  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23078  </code>
23079  Remarks:
23080  None.
23081 */
23082 
23083 void
23085  PORTS_MODULE_ID index ,
23086  PORTS_CHANNEL channel ,
23087  PORTS_BIT_POS bitPos ,
23088  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23089 //DOM-IGNORE-BEGIN
23090 //DOM-IGNORE-END
23091  //SYS_PORTS_H
23092 /*******************************************************************************
23093  End of File
23094 */
23095 
23096 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23097 /* CLOSE_FILE Include File */
23098 
23099 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23100 /*******************************************************************************
23101  SPI Driver Interface
23102  Company:
23103  Microchip Technology Inc.
23104  File Name:
23105  drv_spi.h
23106  Summary:
23107  SPI device driver interface file.
23108  Description:
23109  The SPI driver provides a simple interface to manage the SPI module.
23110  This file defines the interface definitions and prototypes for the SPI driver.
23111 *******************************************************************************/
23112 //DOM-IGNORE-BEGIN
23113 /*******************************************************************************
23114 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23115 Microchip licenses to you the right to use, modify, copy and distribute
23116 Software only when embedded on a Microchip microcontroller or digital signal
23117 controller that is integrated into your product or third party product
23118 (pursuant to the sublicense terms in the accompanying license agreement).
23119 You should refer to the license agreement accompanying this Software for
23120 additional information regarding your rights and obligations.
23121 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23122 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23123 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23124 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23125 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23126 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23127 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23128 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23129 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23130 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23131 *******************************************************************************/
23132 //DOM-IGNORE-END
23133 #ifndef _DRV_SPI_H
23134 #define _DRV_SPI_H
23135 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23136 /*******************************************************************************
23137  SPI Driver Interface
23138  Company:
23139  Microchip Technology Inc.
23140  File Name:
23141  drv_spi_definitions.h
23142  Summary:
23143  SPI device driver interface file.
23144  Description:
23145  The SPI driver provides a simple interface to manage the SPI module.
23146  This file defines the interface definitions and prototypes for the SPI
23147  driver.
23148 *******************************************************************************/
23149 //DOM-IGNORE-BEGIN
23150 /*******************************************************************************
23151 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23152 Microchip licenses to you the right to use, modify, copy and distribute
23153 Software only when embedded on a Microchip microcontroller or digital signal
23154 controller that is integrated into your product or third party product
23155 (pursuant to the sublicense terms in the accompanying license agreement).
23156 You should refer to the license agreement accompanying this Software for
23157 additional information regarding your rights and obligations.
23158 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23159 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23160 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23161 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23162 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23163 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23164 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23165 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23166 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23167 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23168 *******************************************************************************/
23169 //DOM-IGNORE-END
23170 #ifndef _DRV_SPI_DEFINITIONS_H
23171 #define _DRV_SPI_DEFINITIONS_H
23172 // *****************************************************************************
23173 // *****************************************************************************
23174 // Section: Data Types
23175 // *****************************************************************************
23176 // *****************************************************************************
23177 #include <stdint.h>
23178 #include <stdbool.h>
23179 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23180 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23181 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23182 /*******************************************************************************
23183  SPI Peripheral Library Interface Header
23184  Company:
23185  Microchip Technology Inc.
23186  File Name:
23187  plib_spi.h
23188  Summary:
23189  SPI Peripheral Library Interface Header for common definitions.
23190  Description:
23191  This header file contains the function prototypes and definitions of
23192  the data types and constants that make up the interface to the SPI
23193  PLIB.
23194  *******************************************************************************/
23195 // DOM-IGNORE-BEGIN
23196 /*******************************************************************************
23197 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23198 Microchip licenses to you the right to use, modify, copy and distribute
23199 Software only when embedded on a Microchip microcontroller or digital signal
23200 controller that is integrated into your product or third party product
23201 (pursuant to the sublicense terms in the accompanying license agreement).
23202 You should refer to the license agreement accompanying this Software for
23203 additional information regarding your rights and obligations.
23204 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23205 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23206 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23207 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23208 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23209 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23210 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23211 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23212 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23213 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23214  *******************************************************************************/
23215 // DOM-IGNORE-END
23216 #ifndef _PLIB_SPI_H
23217 #define _PLIB_SPI_H
23218 // DOM-IGNORE-BEGIN
23219 // DOM-IGNORE-END
23220 // *****************************************************************************
23221 // *****************************************************************************
23222 // Section: Included Files (continued at end of file)
23223 // *****************************************************************************
23224 // *****************************************************************************
23225 /* This section lists the other files that are included in this file. However,
23226  please see the end of the file for additional implementation header files
23227  that are also included.
23228  */
23229 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23230 //DOM-IGNORE-BEGIN
23231 /*******************************************************************************
23232 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23233 Microchip licenses to you the right to use, modify, copy and distribute
23234 Software only when embedded on a Microchip microcontroller or digital signal
23235 controller that is integrated into your product or third party product
23236 (pursuant to the sublicense terms in the accompanying license agreement).
23237 You should refer to the license agreement accompanying this Software for
23238 additional information regarding your rights and obligations.
23239 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23240 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23241 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23242 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23243 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23244 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23245 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23246 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23247 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23248 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23249  *******************************************************************************/
23250 //DOM-IGNORE-END
23251 #ifndef _PLIB_SPI_PROCESSOR_H
23252 #define _PLIB_SPI_PROCESSOR_H
23253 #error "Can't find header"
23254 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23255 /* CLOSE_FILE Include File */
23256 
23257 // *****************************************************************************
23258 // *****************************************************************************
23259 // Section: Constants & Data Types
23260 // *****************************************************************************
23261 // *****************************************************************************
23262 // *****************************************************************************
23263 // *****************************************************************************
23264 // Section: SPI Peripheral Library Interface Routines
23265 // *****************************************************************************
23266 // *****************************************************************************
23267 //******************************************************************************
23268 /* Function:
23269  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23270  Summary:
23271  Enables the SPI module.
23272  Description:
23273  This function enables the SPI module.
23274  This operation is atomic.
23275  Precondition:
23276  None.
23277  Parameters:
23278  index - Identifier for the device instance to be configured
23279  Returns:
23280  None.
23281  Example:
23282  <code>
23283  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23284  // application developer.
23285  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23286  </code>
23287  Remarks:
23288  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23289  before use.
23290  This function implements an operation of the enable control feature. This
23291  feature may not be available on all devices. Please refer to the specific
23292  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23293  in your application to automatically determine whether this feature is available.
23294  */
23295 
23296 void
23297  PLIB_SPI_Enable (
23298  SPI_MODULE_ID index ) ;
23299 //******************************************************************************
23300 /* Function:
23301  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23302  Summary:
23303  Disables the SPI module.
23304  Description:
23305  This function disables the SPI module.
23306  This operation is atomic.
23307  Precondition:
23308  None.
23309  Parameters:
23310  index - Identifier for the device instance to be configured
23311  Returns:
23312  None.
23313  Example:
23314  <code>
23315  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23316  // application developer.
23317  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23318  </code>
23319  Remarks:
23320  This function implements an operation of the enable control feature. This
23321  feature may not be available on all devices. Please refer to the specific
23322  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23323  in your application to automatically determine whether this feature is available.
23324  */
23325 
23326 void
23328  SPI_MODULE_ID index ) ;
23329 //******************************************************************************
23330 /* Function:
23331  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23332  Summary:
23333  Discontinues module operation when the device enters Idle mode.
23334  Description:
23335  This function sets up the SPI module such that module operation is disabled
23336  when the device enters Idle mode.
23337  This operation is atomic.
23338  Precondition:
23339  None.
23340  Parameters:
23341  index - Identifier for the device instance to be configured
23342  Returns:
23343  None.
23344  Example:
23345  <code>
23346  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23347  // application developer.
23348  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23349  </code>
23350  Remarks:
23351  This function implements an operation of the stop in idle control feature.
23352  This feature may not be available on all devices. Please refer to the
23353  specific device data sheet to determine availability or use
23354  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23355  determine if this feature is available.
23356  */
23357 
23358 void
23360  SPI_MODULE_ID index ) ;
23361 //******************************************************************************
23362 /* Function:
23363  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23364  Summary:
23365  Continues module operation when the device enters Idle mode.
23366  Description:
23367  This function sets up the SPI module such that module operation is continued
23368  when the device enters Idle mode.
23369  This operation is atomic.
23370  Precondition:
23371  None.
23372  Parameters:
23373  index - Identifier for the device instance to be configured
23374  Returns:
23375  None.
23376  Example:
23377  <code>
23378  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23379  // application developer.
23380  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23381  </code>
23382  Remarks:
23383  This function implements an operation of the stop in idle control feature.
23384  This feature may not be available on all devices. Please refer to the
23385  specific device data sheet to determine availability or use
23386  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23387  this feature is available.
23388  */
23389 
23390 void
23392  SPI_MODULE_ID index ) ;
23393 //******************************************************************************
23394 /* Function:
23395  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23396  Summary:
23397  Returns the current status of the SPI receiver overflow.
23398  Description:
23399  This function returns the current status of the SPI receiver overflow.
23400  This operation is atomic.
23401  Precondition:
23402  None.
23403  Parameters:
23404  index - Identifier for the device instance to be configured
23405  Returns:
23406  SPI receiver overflow status:
23407  - true - A new byte/word is completely received and discarded.
23408  The user software has not read the previous data in
23409  the SPI buffer register.
23410  - false - No Overflow has occurred
23411  Example:
23412  <code>
23413  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23414  // application developer.
23415  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23416  </code>
23417  Remarks:
23418  This function implements an operation of the receiver overflow status feature.
23419  This feature may not be available on all devices. Please refer to the
23420  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23421  in your application to automatically determine whether this feature is available.
23422  */
23423 
23424 bool
23426  SPI_MODULE_ID index ) ;
23427 //******************************************************************************
23428 /* Function:
23429  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23430  Summary:
23431  Clears the SPI receive overflow flag.
23432  Description:
23433  This function clears the SPI receive overflow flag.
23434  This operation is atomic.
23435  Precondition:
23436  None.
23437  Parameters:
23438  index - Identifier for the device instance to be configured
23439  Returns:
23440  None.
23441  Example:
23442  <code>
23443  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23444  // application developer.
23445  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23446  </code>
23447  Remarks:
23448  This function implements an operation of the receiver overflow status feature.
23449  This feature may not be available on all devices. Please refer to the
23450  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23451  in your application to automatically determine whether this feature is available.
23452  */
23453 
23454 void
23456  SPI_MODULE_ID index ) ;
23457 //******************************************************************************
23458 /* Function:
23459  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23460  Summary:
23461  Returns the current transmit buffer status of the SPI module.
23462  Description:
23463  This function returns the current transmit buffer status of the SPI module.
23464  This operation is atomic.
23465  Precondition:
23466  None.
23467  Parameters:
23468  index - Identifier for the device instance to be configured
23469  Returns:
23470  - true - Transmit not yet started, transmit buffer is full
23471  - false - Transmit started, transmit buffer is empty/not full
23472  Example:
23473  <code>
23474  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23475  // application developer.
23476  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23477  </code>
23478  Remarks:
23479  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23480  occur, loading the transmit buffer. Automatically cleared in hardware when
23481  the SPI module transfers data from the transmit buffer to the shift register.
23482  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23483  occur, loading the last available buffer. Automatically cleared in hardware
23484  when the buffer is available for writing.
23485  This function implements an operation of the transmit buffer status feature.
23486  This feature may not be available on all devices. Please refer to the
23487  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23488  in your application to automatically determine whether this feature is available.
23489  */
23490 
23491 bool
23493  SPI_MODULE_ID index ) ;
23494 //******************************************************************************
23495 /* Function:
23496  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23497  Summary:
23498  Returns the current status of the SPI receive buffer.
23499  Description:
23500  This function returns the current status of the SPI receive buffer.
23501  This operation is atomic.
23502  Precondition:
23503  None.
23504  Parameters:
23505  index - Identifier for the device instance to be configured
23506  Returns:
23507  Receiver Buffer Full Status:
23508  - true - Receive complete, receive buffer is full
23509  - false - Receive is not complete, receive buffer is empty
23510  Example:
23511  <code>
23512  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23513  // application developer.
23514  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23515  </code>
23516  Remarks:
23517  In Standard Buffer mode - automatically set in hardware when the SPI module
23518  transfers data from the shift register to the receive buffer. Automatically
23519  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23520  In Enhanced Buffer mode - automatically set in hardware when the SPI module
23521  transfers data from the shift register to the receive buffer, filling the
23522  last unread buffer. Automatically cleared in hardware when a buffer is available
23523  for a transfer from the shift register.
23524  This function implements an operation of the receiver buffer status feature.
23525  This feature may not be available on all devices. Please refer to the
23526  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
23527  in your application to automatically determine whether this feature is available.
23528  */
23529 
23530 bool
23532  SPI_MODULE_ID index ) ;
23533 //******************************************************************************
23534 /* Function:
23535  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
23536  Summary:
23537  Enables the selected SPI pins.
23538  Description:
23539  This function enables the selected SPI pins.
23540  Precondition:
23541  None.
23542  Parameters:
23543  index - Identifier for the device instance to be configured
23544  pin - One of the SPI_PIN enumeration values as the SPI pin
23545  Returns:
23546  None.
23547  Example:
23548  <code>
23549  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23550  // application developer.
23551  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23552  </code>
23553  Remarks:
23554  This function implements an operation of the pin control feature.
23555  This feature may not be available on all devices. Please refer to the
23556  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23557  in your application to automatically determine whether this feature is available.
23558  */
23559 
23560 void
23562  SPI_MODULE_ID index ,
23563  SPI_PIN pin ) ;
23564 //******************************************************************************
23565 /* Function:
23566  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
23567  Summary:
23568  Enables the selected SPI pins.
23569  Description:
23570  This function enables the selected SPI pins.
23571  Precondition:
23572  None.
23573  Parameters:
23574  index - Identifier for the device instance to be configured
23575  pin - One of the SPI_PIN enumeration values as the SPI pin
23576  Returns:
23577  None.
23578  Example:
23579  <code>
23580  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23581  // application developer.
23582  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23583  </code>
23584  Remarks:
23585  This function implements an operation of the pin control feature.
23586  This feature may not be available on all devices. Please refer to the
23587  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23588  in your application to automatically determine whether this feature is available.
23589  */
23590 
23591 void
23593  SPI_MODULE_ID index ,
23594  SPI_PIN pin ) ;
23595 //******************************************************************************
23596 /* Function:
23597  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
23598  SPI_COMMUNICATION_WIDTH width )
23599  Summary:
23600  Selects the data width for the SPI communication.
23601  Description:
23602  This function selects the data width for the SPI communication.
23603  This operation is atomic.
23604  Precondition:
23605  None.
23606  Parameters:
23607  index - Identifier for the device instance to be configured
23608  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
23609  SPI buffer width
23610  Returns:
23611  None.
23612  Example:
23613  <code>
23614  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23615  // application developer.
23616  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
23617  </code>
23618  Remarks:
23619  This function implements an operation of the communication width feature.
23620  This feature may not be available on all devices. Please refer to the
23621  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
23622  in your application to automatically determine whether this feature is available.
23623  */
23624 
23625 void
23627  SPI_MODULE_ID index ,
23628  SPI_COMMUNICATION_WIDTH width ) ;
23629 //******************************************************************************
23630 /* Function:
23631  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
23632  SPI_AUDIO_COMMUNICATION_WIDTH width )
23633  Summary:
23634  Selects the data width for the SPI audio communication.
23635  Description:
23636  This function selects the data width for the SPI audio communication.
23637  This operation is atomic.
23638  Precondition:
23639  None.
23640  Parameters:
23641  index - Identifier for the device instance to be configured
23642  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
23643  SPI buffer width
23644  Returns:
23645  None.
23646  Example:
23647  <code>
23648  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23649  // application developer.
23650  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
23651  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
23652  </code>
23653  Remarks:
23654  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
23655  This function implements an operation of the audio communication width feature.
23656  This feature may not be available on all devices. Please refer to the
23657  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
23658  in your application to automatically determine whether this feature is available.
23659  */
23660 
23661 void
23663  SPI_MODULE_ID index ,
23664  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
23665 //******************************************************************************
23666 /* Function:
23667  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
23668  SPI_INPUT_SAMPLING_PHASE phase)
23669  Summary:
23670  Selects the SPI data input sample phase.
23671  Description:
23672  This function selects the input sampling phase in Master mode.
23673  Precondition:
23674  None.
23675  Parameters:
23676  index - Identifier for the device instance to be configured
23677  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
23678  sampling phase
23679  Returns:
23680  None.
23681  Example:
23682  <code>
23683  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23684  // application developer.
23685  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
23686  </code>
23687  Remarks:
23688  This function implements an operation of the input sample phase feature.
23689  This feature may not be available on all devices. Please refer to the
23690  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
23691  in your application to automatically determine whether this feature is available.
23692  */
23693 
23694 void
23696  SPI_MODULE_ID index ,
23697  SPI_INPUT_SAMPLING_PHASE phase ) ;
23698 //******************************************************************************
23699 /* Function:
23700  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
23701  SPI_OUTPUT_DATA_PHASE data)
23702  Summary:
23703  Selects serial output data change.
23704  Description:
23705  This function selects serial output data change.
23706  Precondition:
23707  None.
23708  Parameters:
23709  index - Identifier for the device instance to be configured
23710  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
23711  SPI serial output data change
23712  Returns:
23713  None.
23714  Example:
23715  <code>
23716  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23717  // application developer.
23718  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
23719  </code>
23720  Remarks:
23721  This function implements an operation of the output data phase feature.
23722  This feature may not be available on all devices. Please refer to the
23723  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
23724  in your application to automatically determine whether this feature is available.
23725  */
23726 
23727 void
23729  SPI_MODULE_ID index ,
23730  SPI_OUTPUT_DATA_PHASE phase ) ;
23731 //******************************************************************************
23732 /* Function:
23733  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
23734  SPI_CLOCK_POLARITY polarity)
23735  Summary:
23736  Enables clock polarity.
23737  Description:
23738  This function enables clock polarity.
23739  Precondition:
23740  None.
23741  Parameters:
23742  index - Identifier for the device instance to be configured
23743  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
23744  Returns:
23745  None.
23746  Example:
23747  <code>
23748  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23749  // application developer.
23750  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
23751  </code>
23752  Remarks:
23753  This function implements an operation of the clock polarity feature.
23754  This feature may not be available on all devices. Please refer to the
23755  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
23756  in your application to automatically determine whether this feature is available.
23757  */
23758 
23759 void
23761  SPI_MODULE_ID index ,
23762  SPI_CLOCK_POLARITY polarity ) ;
23763 //******************************************************************************
23764 /* Function:
23765  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
23766  Summary:
23767  Enables the SPI in Master mode.
23768  Description:
23769  This function enables the SPI in Master mode.
23770  This operation is atomic.
23771  Precondition:
23772  None.
23773  Parameters:
23774  index - Identifier for the device instance to be configured
23775  Returns:
23776  None.
23777  Example:
23778  <code>
23779  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23780  // application developer.
23781  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
23782  </code>
23783  Remarks:
23784  This function implements an operation of the master enable control feature.
23785  This feature may not be available on all devices. Please refer to the
23786  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23787  in your application to automatically determine whether this feature is available.
23788  */
23789 
23790 void
23792  SPI_MODULE_ID index ) ;
23793 //******************************************************************************
23794 /* Function:
23795  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
23796  Summary:
23797  Enables the SPI in Slave mode.
23798  Description:
23799  This function enables the SPI in Slave mode.
23800  This operation is atomic.
23801  Precondition:
23802  None.
23803  Parameters:
23804  index - Identifier for the device instance to be configured
23805  Returns:
23806  None.
23807  Example:
23808  <code>
23809  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23810  // application developer.
23811  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
23812  </code>
23813  Remarks:
23814  This function implements an operation of the master enable control feature.
23815  This feature may not be available on all devices. Please refer to the
23816  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23817  in your application to automatically determine whether this feature is available.
23818  */
23819 
23820 void
23822  SPI_MODULE_ID index ) ;
23823 //******************************************************************************
23824 /* Function:
23825  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
23826  uint32_t baudRate )
23827  Summary:
23828  Sets the baud rate to the desired value.
23829  Description:
23830  This function sets the baud rate to the desired value.
23831  Precondition:
23832  None.
23833  Parameters:
23834  index - Identifier for the device instance to be configured
23835  clockFrequency - Clock frequency
23836  baudrate - Baud rate value
23837  Returns:
23838  None.
23839  Example:
23840  <code>
23841  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23842  // application developer.
23843  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
23844  </code>
23845  Remarks:
23846  Setting a new baud rate value causes the baud rate timer to reset.
23847  This ensures that the baud rate timer does not have to overflow before
23848  outputting the new baud rate.
23849  If the system clock is changed during an active receive operation, a
23850  receive error or data loss may result. To avoid this issue, verify that
23851  no receptions are in progress before changing the system clock.
23852  This function implements an operation of the baud rate set feature.
23853  This feature may not be available on all devices. Please refer to the
23854  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
23855  in your application to automatically determine whether this feature is available.
23856  */
23857 
23858 void
23860  SPI_MODULE_ID index ,
23861  uint32_t clockFrequency ,
23862  uint32_t baudRate ) ;
23863 //******************************************************************************
23864 /* Function:
23865  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
23866  Summary:
23867  Returns the current SPI module activity status.
23868  Description:
23869  This function returns the current SPI module activity status.
23870  This operation is atomic.
23871  Precondition:
23872  None.
23873  Parameters:
23874  index - Identifier for the device instance to be configured
23875  Returns:
23876  - true - SPI module is currently busy with some transactions
23877  - false - SPI module is currently idle
23878  Example:
23879  <code>
23880  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23881  // application developer.
23882  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
23883  </code>
23884  Remarks:
23885  This function implements an operation of the bus status feature.
23886  This feature may not be available on all devices. Please refer to the
23887  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
23888  in your application to automatically determine whether this feature is available.
23889  */
23890 
23891 bool
23892  PLIB_SPI_IsBusy (
23893  SPI_MODULE_ID index ) ;
23894 //******************************************************************************
23895 /* Function:
23896  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
23897  Summary:
23898  Returns the current status of the receive (RX) FIFO sign-extended data.
23899  Description:
23900  This function returns the current status of the receive (RX) FIFO
23901  sign-extended data.
23902  This operation is atomic.
23903  Precondition:
23904  None.
23905  Parameters:
23906  index - Identifier for the device instance to be configured
23907  Returns:
23908  - true - Data from RX FIFO is sign-extended
23909  - false - Data from RX FIFO is not sign-extended
23910  Example:
23911  <code>
23912  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23913  // application developer.
23914  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
23915  </code>
23916  Remarks:
23917  This function implements an operation of the data sign feature.
23918  This feature may not be available on all devices. Please refer to the
23919  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
23920  in your application to automatically determine whether this feature is available.
23921  */
23922 
23923 bool
23925  SPI_MODULE_ID index ) ;
23926 //******************************************************************************
23927 /* Function:
23928  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
23929  Summary:
23930  Enables Master mode slave select.
23931  Description:
23932  This function enables Master mode slave select.
23933  This operation is atomic.
23934  Precondition:
23935  None.
23936  Parameters:
23937  index - Identifier for the device instance to be configured
23938  Returns:
23939  None.
23940  Example:
23941  <code>
23942  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23943  // application developer.
23944  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
23945  </code>
23946  Remarks:
23947  This feature does not support Framed SPI mode.
23948  This function implements an operation of the Master mode slave select feature.
23949  This feature may not be available on all devices. Please refer to the
23950  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
23951  in your application to automatically determine whether this feature is available.
23952 
23953  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
23954  */
23955 
23956 void
23958  SPI_MODULE_ID index ) ;
23959 //******************************************************************************
23960 /* Function:
23961  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
23962  Summary:
23963  Disables Master mode slave select.
23964  Description:
23965  This function disables Master mode slave select.
23966  This operation is atomic.
23967  Precondition:
23968  None.
23969  Parameters:
23970  index - Identifier for the device instance to be configured
23971  Returns:
23972  None.
23973  Example:
23974  <code>
23975  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23976  // application developer.
23977  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
23978  </code>
23979  Remarks:
23980  This feature does not support Framed SPI mode.
23981  This function implements an operation of the slave select feature.
23982  This feature may not be available on all devices. Please refer to the
23983  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
23984  in your application to automatically determine whether this feature is available.
23985 
23986  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
23987  */
23988 
23989 void
23991  SPI_MODULE_ID index ) ;
23992 //******************************************************************************
23993 /* Function:
23994  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
23995  Summary:
23996  Returns the current status of the transmit underrun.
23997  Description:
23998  This function returns the current status of the transmit underrun.
23999  This operation is atomic.
24000  Precondition:
24001  None.
24002  Parameters:
24003  index - Identifier for the device instance to be configured
24004  Returns:
24005  - true - Transmit buffer has encountered an underrun condition
24006  - false - Transmit buffer run has not encountered an underrun condition
24007  Example:
24008  <code>
24009  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24010  // application developer.
24011  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24012  </code>
24013  Remarks:
24014  Valid in Framed Sync mode.
24015  This function implements an operation of the transmit underrun status feature.
24016  This feature may not be available on all devices. Please refer to the
24017  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24018  in your application to automatically determine whether this feature is available.
24019  */
24020 
24021 bool
24023  SPI_MODULE_ID index ) ;
24024 //******************************************************************************
24025 /* Function:
24026  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24027  Summary:
24028  Clears the SPI transmit underrun flag.
24029  Description:
24030  This function clears the SPI transmit underrun flag.
24031  This operation is atomic.
24032  Precondition:
24033  None.
24034  Parameters:
24035  index - Identifier for the device instance to be configured
24036  Returns:
24037  None.
24038  Example:
24039  <code>
24040  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24041  // application developer.
24042  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24043  </code>
24044  Remarks:
24045  This function implements an operation of the transmit underrun status feature.
24046  This feature may not be available on all devices. Please refer to the
24047  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24048  in your application to automatically determine whether this feature is available.
24049  */
24050 
24051 void
24053  SPI_MODULE_ID index ) ;
24054 //******************************************************************************
24055 /* Function:
24056  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24057  Summary:
24058  Returns the current status of the transmit buffer.
24059  Description:
24060  This function returns the current status of the transmit buffer.
24061  This operation is atomic.
24062  Precondition:
24063  None.
24064  Parameters:
24065  index - Identifier for the device instance to be configured
24066  Returns:
24067  - true - Transmit buffer is empty
24068  - false - Transmit buffer is not empty
24069  Example:
24070  <code>
24071  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24072  // application developer.
24073  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24074  </code>
24075  Remarks:
24076  This function implements an operation of the transmit buffer empty status feature.
24077  This feature may not be available on all devices. Please refer to the
24078  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24079  in your application to automatically determine whether this feature is available.
24080  */
24081 
24082 bool
24084  SPI_MODULE_ID index ) ;
24085 //******************************************************************************
24086 /* Function:
24087  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24088  Summary:
24089  Enables the SPI enhanced buffer.
24090  Description:
24091  This function enables the SPI enhanced buffer.
24092  This operation is atomic.
24093  Precondition:
24094  None.
24095  Parameters:
24096  index - Identifier for the device instance to be configured
24097  Returns:
24098  None.
24099  Example:
24100  <code>
24101  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24102  // application developer.
24103  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24104  </code>
24105  Remarks:
24106  This enables the enhanced buffer mode.
24107  This function implements an operation of the FIFO control feature.
24108  This feature may not be available on all devices. Please refer to the
24109  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24110  in your application to automatically determine whether this feature is available.
24111  */
24112 
24113 void
24115  SPI_MODULE_ID index ) ;
24116 //******************************************************************************
24117 /* Function:
24118  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24119  Summary:
24120  Disables the SPI enhanced buffer.
24121  Description:
24122  This function disables the SPI enhanced buffer.
24123  This operation is atomic.
24124  Precondition:
24125  None.
24126  Parameters:
24127  index - Identifier for the device instance to be configured
24128  Returns:
24129  None.
24130  Example:
24131  <code>
24132  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24133  // application developer.
24134  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24135  </code>
24136  Remarks:
24137  Enables the legacy standard single buffer mode.
24138  This function implements an operation of the FIFO control feature.
24139  This feature may not be available on all devices. Please refer to the
24140  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24141  in your application to automatically determine whether this feature is available.
24142  */
24143 
24144 void
24146  SPI_MODULE_ID index ) ;
24147 //******************************************************************************
24148 /* Function:
24149  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24150  Summary:
24151  Reads the SPI Buffer Element Count bits for either receive or transmit.
24152  Description:
24153  This function reads the number of SPI transfers pending for Master mode
24154  and the number of unread SPI transfers for Slave mode.
24155  Precondition:
24156  None.
24157  Parameters:
24158  index - Identifier for the device instance to be configured
24159  type - One of the SPI_FIFO_TYPE enumeration values
24160  Returns:
24161  CountValue - Buffer element count bits
24162  Example:
24163  <code>
24164  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24165  // application developer.
24166  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24167  </code>
24168  Remarks:
24169  Valid in Enhanced Buffer mode.
24170  This function implements an operation of the FIFO control feature.
24171  This feature may not be available on all devices. Please refer to the
24172  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24173  in your application to automatically determine whether this feature is available.
24174  */
24175 
24176 uint8_t
24178  SPI_MODULE_ID index ,
24179  SPI_FIFO_TYPE type ) ;
24180 //******************************************************************************
24181 /* Function:
24182  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24183  Summary:
24184  Returns the current status of the SPI shift register.
24185  Description:
24186  This function returns the current status of the SPI shift register.
24187  This operation is atomic.
24188  Precondition:
24189  None.
24190  Parameters:
24191  index - Identifier for the device instance to be configured
24192  Returns:
24193  - true - SPI shift register is empty and ready to send or receive
24194  - false - SPI shift register is not empty
24195  Example:
24196  <code>
24197  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24198  // application developer.
24199  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24200  </code>
24201  Remarks:
24202  Valid in Enhanced Buffer mode.
24203  This function implements an operation of the FIFO status feature.
24204  This feature may not be available on all devices. Please refer to the
24205  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24206  in your application to automatically determine whether this feature is available.
24207  */
24208 
24209 bool
24211  SPI_MODULE_ID index ) ;
24212 //******************************************************************************
24213 /* Function:
24214  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24215  Summary:
24216  Returns the current status of the SPI receive FIFO.
24217  Description:
24218  This function returns the current status of the SPI receive FIFO.
24219  This operation is atomic.
24220  Precondition:
24221  None.
24222  Parameters:
24223  index - Identifier for the device instance to be configured
24224  Returns:
24225  - true - Receive FIFO is empty
24226  - false - Receive FIFO is not empty
24227  Example:
24228  <code>
24229  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24230  // application developer.
24231  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24232  </code>
24233  Remarks:
24234  Valid in Enhanced Buffer mode.
24235  This function implements an operation of the FIFO status feature.
24236  This feature may not be available on all devices. Please refer to the
24237  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24238  in your application to automatically determine whether this feature is available.
24239  */
24240 
24241 bool
24243  SPI_MODULE_ID index ) ;
24244 //******************************************************************************
24245 /* Function:
24246  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24247  SPI_FIFO_INTERRUPT mode)
24248  Summary:
24249  Selects the SPI buffer interrupt mode.
24250  Description:
24251  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24252  Precondition:
24253  None.
24254  Parameters:
24255  index - Identifier for the device instance to be configured
24256  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24257  interrupt mode
24258  Returns:
24259  None.
24260  Example:
24261  <code>
24262  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24263  // application developer.
24264  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24265  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24266  </code>
24267  Remarks:
24268  Valid in Enhanced Buffer mode.
24269  This function implements an operation of the FIFO interrupt feature.
24270  This feature may not be available on all devices. Please refer to the
24271  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24272  in your application to automatically determine whether this feature is available.
24273  */
24274 
24275 void
24277  SPI_MODULE_ID index ,
24278  SPI_FIFO_INTERRUPT mode ) ;
24279 //******************************************************************************
24280 /* Function:
24281  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24282  Summary:
24283  Enables framed SPI support.
24284  Description:
24285  This function enables framed SPI support.
24286  This operation is atomic.
24287  Precondition:
24288  None.
24289  Parameters:
24290  index - Identifier for the device instance to be configured
24291  Returns:
24292  None.
24293  Example:
24294  <code>
24295  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24296  // application developer.
24297  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24298  </code>
24299  Remarks:
24300  This function implements an operation of the framed communication feature.
24301  This feature may not be available on all devices. Please refer to the
24302  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24303  in your application to automatically determine whether this feature is available.
24304  */
24305 
24306 void
24308  SPI_MODULE_ID index ) ;
24309 //******************************************************************************
24310 /* Function:
24311  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24312  Summary:
24313  Disables framed SPI support.
24314  Description:
24315  This function disables framed SPI support.
24316  This operation is atomic.
24317  Precondition:
24318  None.
24319  Parameters:
24320  index - Identifier for the device instance to be configured
24321  Returns:
24322  None.
24323  Example:
24324  <code>
24325  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24326  // application developer.
24327  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24328  </code>
24329  Remarks:
24330  This function implements an operation of the framed communication feature.
24331  This feature may not be available on all devices. Please refer to the
24332  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24333  in your application to automatically determine whether this feature is available.
24334  */
24335 
24336 void
24338  SPI_MODULE_ID index ) ;
24339 //******************************************************************************
24340 /* Function:
24341  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24342  SPI_FRAME_PULSE_DIRECTION direction)
24343  Summary:
24344  Selects the frame sync pulse direction.
24345  Description:
24346  This function selects the frame sync pulse direction.
24347  Precondition:
24348  None.
24349  Parameters:
24350  index - Identifier for the device instance to be configured
24351  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24352  as the SPI frame sync pulse polarity
24353  Returns:
24354  None.
24355  Example:
24356  <code>
24357  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24358  // application developer.
24359  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24360  </code>
24361  Remarks:
24362  This function implements an operation of the framed communication feature.
24363  This feature may not be available on all devices. Please refer to the
24364  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24365  in your application to automatically determine whether this feature is available.
24366  */
24367 
24368 void
24370  SPI_MODULE_ID index ,
24371  SPI_FRAME_PULSE_DIRECTION direction ) ;
24372 //******************************************************************************
24373 /* Function:
24374  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24375  SPI_FRAME_PULSE_POLARITY polarity)
24376  Summary:
24377  Selects the frame sync pulse polarity.
24378  Description:
24379  This function selects the frame sync pulse polarity.
24380  Precondition:
24381  None.
24382  Parameters:
24383  index - Identifier for the device instance to be configured
24384  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24385  sync pulse polarity
24386  Returns:
24387  None.
24388  Example:
24389  <code>
24390  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24391  // application developer.
24392  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24393  </code>
24394  Remarks:
24395  Available only for Frame mode.
24396  This function implements an operation of the framed communication feature.
24397  This feature may not be available on all devices. Please refer to the
24398  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24399  in your application to automatically determine whether this feature is available.
24400  */
24401 
24402 void
24404  SPI_MODULE_ID index ,
24405  SPI_FRAME_PULSE_POLARITY polarity ) ;
24406 //******************************************************************************
24407 /* Function:
24408  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24409  SPI_FRAME_PULSE_EDGE edge)
24410  Summary:
24411  Selects the frame sync pulse edge.
24412  Description:
24413  This function selects the frame sync pulse edge.
24414  Precondition:
24415  None.
24416  Parameters:
24417  index - Identifier for the device instance to be configured
24418  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24419  SPI frame sync pulse edge
24420  Returns:
24421  None.
24422  Example:
24423  <code>
24424  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24425  // application developer.
24426  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24427  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24428  </code>
24429  Remarks:
24430  This function implements an operation of the framed communication feature.
24431  This feature may not be available on all devices. Please refer to the
24432  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24433  in your application to automatically determine whether this feature is available.
24434  */
24435 
24436 void
24438  SPI_MODULE_ID index ,
24439  SPI_FRAME_PULSE_EDGE edge ) ;
24440 //******************************************************************************
24441 /* Function:
24442  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24443  SPI_FRAME_PULSE_WIDTH width)
24444  Summary:
24445  Sets the frame sync pulse width.
24446  Description:
24447  This function sets the frame sync pulse width.
24448  Precondition:
24449  None.
24450  Parameters:
24451  index - Identifier for the device instance to be configured
24452  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24453  frame sync pulse width.
24454  Returns:
24455  None.
24456  Example:
24457  <code>
24458  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24459  // application developer.
24460  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24461  </code>
24462  Remarks:
24463  Length of the word is dependent on the communication mode.
24464  This function implements an operation of the framed communication feature.
24465  This feature may not be available on all devices. Please refer to the
24466  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24467  in your application to automatically determine whether this feature is available.
24468  */
24469 
24470 void
24472  SPI_MODULE_ID index ,
24473  SPI_FRAME_PULSE_WIDTH width ) ;
24474 //******************************************************************************
24475 /* Function:
24476  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24477  SPI_FRAME_SYNC_PULSE pulse)
24478  Summary:
24479  Selects at which character the SPI frame sync pulse is generated.
24480  Description:
24481  This function selects at which character the SPI frame sync pulse is generated.
24482  Precondition:
24483  None.
24484  Parameters:
24485  index - Identifier for the device instance to be configured
24486  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24487  frame sync pulse count
24488  Returns:
24489  None.
24490  Example:
24491  <code>
24492  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24493  // application developer.
24494  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24495  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24496  </code>
24497  Remarks:
24498  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24499  This function implements an operation of the framed communication feature.
24500  This feature may not be available on all devices. Please refer to the
24501  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24502  in your application to automatically determine whether this feature is available.
24503  */
24504 
24505 void
24507  SPI_MODULE_ID index ,
24508  SPI_FRAME_SYNC_PULSE pulse ) ;
24509 //******************************************************************************
24510 /* Function:
24511  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24512  Summary:
24513  Returns the current status of the SPI frame error.
24514  Description:
24515  This function returns the current status of the SPI frame error.
24516  This operation is atomic.
24517  Precondition:
24518  None.
24519  Parameters:
24520  index - Identifier for the device instance to be configured
24521  Returns:
24522  - true - Frame error detected
24523  - false - No frame error detected
24524  Example:
24525  <code>
24526  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24527  // application developer.
24528  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
24529  </code>
24530  Remarks:
24531  Valid only if Frame mode is enabled.
24532  This function implements an operation of the framed communication feature.
24533  This feature may not be available on all devices. Please refer to the
24534  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
24535  in your application to automatically determine whether this feature is available.
24536  */
24537 
24538 bool
24540  SPI_MODULE_ID index ) ;
24541 //******************************************************************************
24542 /* Function:
24543  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
24544  Summary:
24545  Clears the SPI frame error flag.
24546  Description:
24547  This function clears the SPI frame error flag.
24548  This operation is atomic.
24549  Precondition:
24550  None.
24551  Parameters:
24552  index - Identifier for the device instance to be configured
24553  Returns:
24554  None.
24555  Example:
24556  <code>
24557  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24558  // application developer.
24559  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
24560  </code>
24561  Remarks:
24562  This function implements an operation of the frame error status feature.
24563  This feature may not be available on all devices. Please refer to the
24564  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
24565  in your application to automatically determine whether this feature is available.
24566  */
24567 
24568 void
24570  SPI_MODULE_ID index ) ;
24571 //******************************************************************************
24572 /* Function:
24573  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
24574  Summary:
24575  Clears the SPI receive buffer.
24576  Description:
24577  This function clears the SPI receive buffer.
24578  In Enhanced Buffer mode, this functions clears the full RX FIFO.
24579  This operation is atomic.
24580  Precondition:
24581  None.
24582  Parameters:
24583  index - Identifier for the device instance to be configured
24584  Returns:
24585  None.
24586  Example:
24587  <code>
24588  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24589  // application developer.
24590  //This call will flush the receive buffer.
24591  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
24592  </code>
24593  Remarks:
24594  This function implements an operation of the buffer control feature.
24595  This feature may not be available on all devices. Please refer to the
24596  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24597  in your application to automatically determine whether this feature is available.
24598  */
24599 
24600 void
24602  SPI_MODULE_ID index ) ;
24603 //******************************************************************************
24604 /* Function:
24605  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
24606  Summary:
24607  Returns the SPI buffer value.
24608  Description:
24609  This function returns the SPI buffer value.
24610  This operation is atomic.
24611  Precondition:
24612  None.
24613  Parameters:
24614  index - Identifier for the device instance to be configured
24615  Returns:
24616  Reads the SPI buffer.
24617  Example:
24618  <code>
24619  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24620  // application developer.
24621  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
24622  </code>
24623  Remarks:
24624  This function implements an operation of the buffer control feature.
24625  This feature may not be available on all devices. Please refer to the
24626  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24627  in your application to automatically determine whether this feature is available.
24628  */
24629 
24630 uint8_t
24632  SPI_MODULE_ID index ) ;
24633 //******************************************************************************
24634 /* Function:
24635  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
24636  Summary:
24637  Returns 16-bit SPI buffer value.
24638  Description:
24639  This function returns 16-bit SPI buffer value.
24640  This operation is atomic.
24641  Precondition:
24642  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24643  Parameters:
24644  index - Identifier for the device instance to be configured
24645  Returns:
24646  Returns the SPI 16-bit buffer value.
24647  Example:
24648  <code>
24649 #define MY_SPI_INSTANCE SPI_ID_1
24650 
24651  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
24652  </code>
24653  Remarks:
24654  This function implements an operation of the buffer control feature.
24655  This feature may not be available on all devices. Please refer to the
24656  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24657  in your application to automatically determine whether this feature is available.
24658  */
24659 
24660 uint16_t
24662  SPI_MODULE_ID index ) ;
24663 //******************************************************************************
24664 /* Function:
24665  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
24666  Summary:
24667  Returns 32-bit SPI buffer value.
24668  Description:
24669  This function returns 32-bit SPI buffer value.
24670  This operation is atomic.
24671  Precondition:
24672  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24673  Parameters:
24674  index - Identifier for the device instance to be configured
24675  Returns:
24676  Returns the SPI 32-bit buffer value.
24677  Example:
24678  <code>
24679 #define MY_SPI_INSTANCE SPI_ID_1
24680 
24681  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
24682  </code>
24683  Remarks:
24684  This function implements an operation of the buffer control feature.
24685  This feature may not be available on all devices. Please refer to the
24686  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24687  in your application to automatically determine whether this feature is available.
24688  */
24689 
24690 uint32_t
24692  SPI_MODULE_ID index ) ;
24693 //******************************************************************************
24694 /* Function:
24695  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
24696  Summary:
24697  Write the data to the SPI buffer.
24698  Description:
24699  This function writes data to the SPI buffer.
24700  This operation is atomic.
24701  Precondition:
24702  None.
24703  Parameters:
24704  index - Identifier for the device instance to be configured
24705  data - Data to written to the SPI buffer
24706  Returns:
24707  None.
24708  Example:
24709  <code>
24710  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24711  // application developer.
24712  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
24713  </code>
24714  Remarks:
24715  This function implements an operation of the buffer control feature.
24716  This feature may not be available on all devices. Please refer to the
24717  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24718  in your application to automatically determine whether this feature is available.
24719  */
24720 
24721 void
24723  SPI_MODULE_ID index ,
24724  uint8_t data ) ;
24725 //******************************************************************************
24726 /* Function:
24727  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
24728  Summary:
24729  Writes 16-bit data to the SPI buffer.
24730  Description:
24731  This function writes 16-bit data to the SPI buffer.
24732  This operation is atomic.
24733  Precondition:
24734  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24735  Parameters:
24736  index - Identifier for the device instance to be configured
24737  data - 16-bit data to be written to the SPI buffer
24738  Returns:
24739  None.
24740  Example:
24741  <code>
24742 #define MY_SPI_INSTANCE SPI_ID_1
24743 
24744  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
24745  </code>
24746  Remarks:
24747  This function implements an operation of the buffer control feature.
24748  This feature may not be available on all devices. Please refer to the
24749  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24750  in your application to automatically determine whether this feature is available.
24751  */
24752 
24753 void
24755  SPI_MODULE_ID index ,
24756  uint16_t data ) ;
24757 //******************************************************************************
24758 /* Function:
24759  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
24760  Summary:
24761  Write 32-bit data to the SPI buffer.
24762  Description:
24763  This function writes 32-bit data to the SPI buffer.
24764  This operation is atomic.
24765  Precondition:
24766  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24767  Parameters:
24768  index - Identifier for the device instance to be configured
24769  data - 32-bit data to be written to the SPI buffer
24770  Returns:
24771  None.
24772  Example:
24773  <code>
24774 #define MY_SPI_INSTANCE SPI_ID_1
24775 
24776  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
24777  </code>
24778  Remarks:
24779  This function implements an operation of the buffer control feature.
24780  This feature may not be available on all devices. Please refer to the
24781  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24782  in your application to automatically determine whether this feature is available.
24783  */
24784 
24785 void
24787  SPI_MODULE_ID index ,
24788  uint32_t data ) ;
24789 //******************************************************************************
24790 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
24791  Summary:
24792  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
24793  register.
24794  Description:
24795  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
24796  (SPIxRXB)) register.
24797  This operation is atomic.
24798  Preconditions:
24799  None.
24800  Parameters:
24801  index - Identifier for the device instance
24802  Returns:
24803  The address of the SPIxBUF register
24804  Remarks:
24805  None.
24806 */
24807 
24808 void *
24810  SPI_MODULE_ID index ) ;
24811 //******************************************************************************
24812 /* Function:
24813  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
24814  SPI_BAUD_RATE_CLOCK type)
24815  Summary:
24816  Selects the type of clock is used by the Baud Rate Generator.
24817  Description:
24818  This function selects the type of clock is used by the Baud Rate Generator.
24819  Precondition:
24820  None.
24821  Parameters:
24822  index - Identifier for the device instance to be configured
24823  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
24824  Returns:
24825  None.
24826  Example:
24827  <code>
24828  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24829  // application developer.
24830  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
24831  </code>
24832  Remarks:
24833  This function implements an operation of the baud rate clock control feature.
24834  This feature may not be available on all devices. Please refer to the
24835  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
24836  in your application to automatically determine whether this feature is available.
24837  */
24838 
24839 void
24841  SPI_MODULE_ID index ,
24842  SPI_BAUD_RATE_CLOCK type ) ;
24843 //******************************************************************************
24844 /* Function:
24845  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
24846  SPI_ERROR_INTERRUPT error)
24847  Summary:
24848  Enables SPI error interrupts
24849  Description:
24850  This function enables SPI error interrupts.
24851  Precondition:
24852  None.
24853  Parameters:
24854  index - Identifier for the device instance to be configured
24855  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
24856  SPI interrupt error
24857  Returns:
24858  None.
24859  Example:
24860  <code>
24861  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24862  // application developer.
24863  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24864  </code>
24865  Remarks:
24866  This function implements an operation of the error interrupt control feature.
24867  This feature may not be available on all devices. Please refer to the
24868  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24869  in your application to automatically determine whether this feature is available.
24870  */
24871 
24872 void
24874  SPI_MODULE_ID index ,
24875  SPI_ERROR_INTERRUPT error ) ;
24876 //******************************************************************************
24877 /* Function:
24878  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
24879  SPI_ERROR_INTERRUPT error)
24880  Summary:
24881  Enables SPI error interrupts.
24882  Description:
24883  This function enables SPI error interrupts.
24884  Precondition:
24885  None.
24886  Parameters:
24887  index - Identifier for the device instance to be configured
24888  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
24889  SPI interrupt error
24890  Returns:
24891  None.
24892  Example:
24893  <code>
24894  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24895  // application developer.
24896  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24897  </code>
24898  Remarks:
24899  This function implements an operation of the error interrupt control feature.
24900  This feature may not be available on all devices. Please refer to the
24901  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24902  in your application to automatically determine whether this feature is available.
24903  */
24904 
24905 void
24907  SPI_MODULE_ID index ,
24908  SPI_ERROR_INTERRUPT error ) ;
24909 //******************************************************************************
24910 /* Function:
24911  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
24912  Summary:
24913  Enables the SPI error.
24914  Description:
24915  This function enables the SPI error.
24916  This operation is atomic.
24917  Precondition:
24918  None.
24919  Parameters:
24920  index - Identifier for the device instance to be configured
24921  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24922  Returns:
24923  None.
24924  Example:
24925  <code>
24926  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24927  // application developer.
24928  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24929  </code>
24930  Remarks:
24931  This function implements an operation of the audio error control feature.
24932  This feature may not be available on all devices. Please refer to the
24933  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24934  in your application to automatically determine whether this feature is available.
24935  */
24936 
24937 void
24939  SPI_MODULE_ID index ,
24940  SPI_AUDIO_ERROR error ) ;
24941 //******************************************************************************
24942 /* Function:
24943  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
24944  Summary:
24945  Disables the SPI error.
24946  Description:
24947  This function disables the SPI error.
24948  This operation is atomic.
24949  Precondition:
24950  None.
24951  Parameters:
24952  index - Identifier for the device instance to be configured
24953  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24954  Returns:
24955  None.
24956  Example:
24957  <code>
24958  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24959  // application developer.
24960  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24961  </code>
24962  Remarks:
24963  This function implements an operation of the audio error control feature.
24964  This feature may not be available on all devices. Please refer to the
24965  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24966  in your application to automatically determine whether this feature is available.
24967  */
24968 
24969 void
24971  SPI_MODULE_ID index ,
24972  SPI_AUDIO_ERROR error ) ;
24973 //******************************************************************************
24974 /* Function:
24975  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
24976  Summary:
24977  Audio protocol is enabled.
24978  Description:
24979  This function enables the audio protocol.
24980  This operation is atomic.
24981  Precondition:
24982  Disable the SPI module by calling PLIB_SPI_Disable.
24983  Parameters:
24984  index - Identifier for the device instance to be configured
24985  Returns:
24986  None.
24987  Example:
24988  <code>
24989  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24990  // application developer.
24991  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
24992  </code>
24993  Remarks:
24994  This function implements an operation of the audio protocol control feature.
24995  This feature may not be available on all devices. Please refer to the
24996  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
24997  in your application to automatically determine whether this feature is available.
24998  */
24999 
25000 void
25002  SPI_MODULE_ID index ) ;
25003 //******************************************************************************
25004 /* Function:
25005  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25006  Summary:
25007  Audio protocol is disabled.
25008  Description:
25009  This function disables the audio protocol.
25010  This operation is atomic.
25011  Precondition:
25012  None.
25013  Parameters:
25014  index - Identifier for the device instance to be configured
25015  Returns:
25016  None.
25017  Example:
25018  <code>
25019  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25020  // application developer.
25021  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25022  </code>
25023  Remarks:
25024  This function implements an operation of the audio protocol control feature.
25025  This feature may not be available on all devices. Please refer to the
25026  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25027  in your application to automatically determine whether this feature is available.
25028  */
25029 
25030 void
25032  SPI_MODULE_ID index ) ;
25033 //******************************************************************************
25034 /* Function:
25035  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25036  SPI_AUDIO_TRANSMIT_MODE mode)
25037  Summary:
25038  Selects the transmit audio data format.
25039  Description:
25040  This function selects the transmit audio data format.
25041  Precondition:
25042  None.
25043  Parameters:
25044  index - Identifier for the device instance to be configured
25045  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25046  transmit audio format
25047  Returns:
25048  None.
25049  Example:
25050  <code>
25051  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25052  // application developer.
25053  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25054  </code>
25055  Remarks:
25056  This function implements an operation of the audio transmit mode feature.
25057  This feature may not be available on all devices. Please refer to the
25058  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25059  in your application to automatically determine whether this feature is available.
25060  */
25061 
25062 void
25064  SPI_MODULE_ID index ,
25065  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25066 //******************************************************************************
25067 /* Function:
25068  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25069  SPI_AUDIO_PROTOCOL mode )
25070  Summary:
25071  Selects the Audio Protocol mode.
25072  Description:
25073  This function selects the Audio Protocol mode.
25074  Precondition:
25075  None.
25076  Parameters:
25077  index - Identifier for the device instance to be configured
25078  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25079  audio protocol
25080  Returns:
25081  None.
25082  Example:
25083  <code>
25084  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25085  // application developer.
25086  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25087  </code>
25088  Remarks:
25089  This function implements an operation of the audio protocol mode feature.
25090  This feature may not be available on all devices. Please refer to the
25091  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25092  in your application to automatically determine whether this feature is available.
25093  */
25094 
25095 void
25097  SPI_MODULE_ID index ,
25098  SPI_AUDIO_PROTOCOL mode ) ;
25099 // *****************************************************************************
25100 // *****************************************************************************
25101 // Section: SPI Peripheral Library Exists Functions
25102 // *****************************************************************************
25103 // *****************************************************************************
25104 /* The following functions indicate the existence of the features on the device.
25105 */
25106 //******************************************************************************
25107 /* Function:
25108  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25109  Summary:
25110  Identifies whether the EnableControl feature exists on the SPI module.
25111  Description:
25112  This function identifies whether the EnableControl feature is available on
25113  the SPI module.
25114  When this function returns true, these functions are supported on the device:
25115  - PLIB_SPI_Enable
25116  - PLIB_SPI_Disable
25117  This operation is atomic.
25118  Preconditions:
25119  None.
25120  Parameters:
25121  index - Identifier for the device instance
25122  Returns:
25123  - true - The EnableControl feature is supported on the device
25124  - false - The EnableControl feature is not supported on the device
25125  Remarks:
25126  None.
25127 */
25128 
25129 bool
25131  SPI_MODULE_ID index ) ;
25132 //******************************************************************************
25133 /* Function:
25134  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25135  Summary:
25136  Identifies whether the StopInIdle feature exists on the SPI module.
25137  Description:
25138  This function identifies whether the StopInIdle feature is available on the
25139  SPI module.
25140  When this function returns true, these functions are supported on the device:
25141  - PLIB_SPI_StopInIdleEnable
25142  - PLIB_SPI_StopInIdleDisable
25143  This operation is atomic.
25144  Preconditions:
25145  None.
25146  Parameters:
25147  index - Identifier for the device instance
25148  Returns:
25149  - true - The StopInIdle feature is supported on the device
25150  - false - The StopInIdle feature is not supported on the device
25151  Remarks:
25152  None.
25153 */
25154 
25155 bool
25157  SPI_MODULE_ID index ) ;
25158 //******************************************************************************
25159 /* Function:
25160  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25161  Summary:
25162  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25163  Description:
25164  This function identifies whether the ReceiverOverflow feature is available
25165  on the SPI module.
25166  When this function returns true, these functions are supported on the device:
25167  - PLIB_SPI_ReceiverHasOverflowed
25168  - PLIB_SPI_ReceiverOverflowClear
25169  This operation is atomic.
25170  Preconditions:
25171  None.
25172  Parameters:
25173  index - Identifier for the device instance
25174  Returns:
25175  - true - The ReceiverOverflow feature is supported on the device
25176  - false - The ReceiverOverflow feature is not supported on the device
25177  Remarks:
25178  None.
25179 */
25180 
25181 bool
25183  SPI_MODULE_ID index ) ;
25184 //******************************************************************************
25185 /* Function:
25186  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25187  Summary:
25188  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25189  Description:
25190  This function identifies whether the TransmitBufferFullStatus feature is available
25191  on the SPI module.
25192  When this function returns true, this function is supported on the device:
25193  - PLIB_SPI_TransmitBufferIsFull
25194  This operation is atomic.
25195  Preconditions:
25196  None.
25197  Parameters:
25198  index - Identifier for the device instance
25199  Returns:
25200  - true - The TransmitBufferFullStatus feature is supported on the device
25201  - false - The TransmitBufferFullStatus feature is not supported on the device
25202  Remarks:
25203  None.
25204 */
25205 
25206 bool
25208  SPI_MODULE_ID index ) ;
25209 //******************************************************************************
25210 /* Function:
25211  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25212  Summary:
25213  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25214  Description:
25215  This function identifies whether the TransmitBufferEmptyStatus feature is available
25216  on the SPI module.
25217  When this function returns true, this function is supported on the device:
25218  - PLIB_SPI_TransmitBufferIsEmpty
25219  This operation is atomic.
25220  Preconditions:
25221  None.
25222  Parameters:
25223  index - Identifier for the device instance
25224  Returns:
25225  - true - The TransmitBufferEmptyStatus feature is supported on the device
25226  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25227  Remarks:
25228  None.
25229 */
25230 
25231 bool
25233  SPI_MODULE_ID index ) ;
25234 //******************************************************************************
25235 /* Function:
25236  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25237  Summary:
25238  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25239  Description:
25240  This function identifies whether the ReceiveBufferStatus feature is available
25241  on the SPI module.
25242  When this function returns true, this function is supported on the device:
25243  - PLIB_SPI_ReceiverBufferIsFull
25244  This operation is atomic.
25245  Preconditions:
25246  None.
25247  Parameters:
25248  index - Identifier for the device instance
25249  Returns:
25250  - true - The ReceiveBufferStatus feature is supported on the device
25251  - false - The ReceiveBufferStatus feature is not supported on the device
25252  Remarks:
25253  None.
25254 */
25255 
25256 bool
25258  SPI_MODULE_ID index ) ;
25259 //******************************************************************************
25260 /* Function:
25261  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25262  Summary:
25263  Identifies whether the PinControl feature exists on the SPI module.
25264  Description:
25265  This function identifies whether the PinControl feature is available on the
25266  SPI module.
25267  When this function returns true, these functions are supported on the device:
25268  - PLIB_SPI_PinEnable
25269  - PLIB_SPI_PinDisable
25270  This operation is atomic.
25271  Preconditions:
25272  None.
25273  Parameters:
25274  index - Identifier for the device instance
25275  Returns:
25276  - true - The PinControl feature is supported on the device
25277  - false - The PinControl feature is not supported on the device
25278  Remarks:
25279  None.
25280 */
25281 
25282 bool
25284  SPI_MODULE_ID index ) ;
25285 //******************************************************************************
25286 /* Function:
25287  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25288  Summary:
25289  Identifies whether the CommunicationWidth feature exists on the SPI module.
25290  Description:
25291  This function identifies whether the CommunicationWidth feature is available
25292  on the SPI module.
25293  When this function returns true, this function is supported on the device:
25294  - PLIB_SPI_CommunicationWidthSelect
25295  This operation is atomic.
25296  Preconditions:
25297  None.
25298  Parameters:
25299  index - Identifier for the device instance
25300  Returns:
25301  - true - The CommunicationWidth feature is supported on the device
25302  - false - The CommunicationWidth feature is not supported on the device
25303  Remarks:
25304  None.
25305 */
25306 
25307 bool
25309  SPI_MODULE_ID index ) ;
25310 //******************************************************************************
25311 /* Function:
25312  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25313  Summary:
25314  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25315  Description:
25316  This function identifies whether the AudioCommunicationWidth feature is available
25317  on the SPI module.
25318  When this function returns true, this function is supported on the device:
25319  - PLIB_SPI_AudioCommunicationWidthSelect
25320  This operation is atomic.
25321  Preconditions:
25322  None.
25323  Parameters:
25324  index - Identifier for the device instance
25325  Returns:
25326  - true - The AudioCommunicationWidth feature is supported on the device
25327  - false - The AudioCommunicationWidth feature is not supported on the device
25328  Remarks:
25329  None.
25330 */
25331 
25332 bool
25334  SPI_MODULE_ID index ) ;
25335 //******************************************************************************
25336 /* Function:
25337  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25338  Summary:
25339  Identifies whether the InputSamplePhase feature exists on the SPI module.
25340  Description:
25341  This function identifies whether the InputSamplePhase feature is available
25342  on the SPI module.
25343  When this function returns true, this function is supported on the device:
25344  - PLIB_SPI_InputSamplePhaseSelect
25345  This operation is atomic.
25346  Preconditions:
25347  None.
25348  Parameters:
25349  index - Identifier for the device instance
25350  Returns:
25351  - true - The InputSamplePhase feature is supported on the device
25352  - false - The InputSamplePhase feature is not supported on the device
25353  Remarks:
25354  None.
25355 */
25356 
25357 bool
25359  SPI_MODULE_ID index ) ;
25360 //******************************************************************************
25361 /* Function:
25362  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25363  Summary:
25364  Identifies whether the OutputDataPhase feature exists on the SPI module.
25365  Description:
25366  This function identifies whether the OutputDataPhase feature is available on
25367  the SPI module.
25368  When this function returns true, this function is supported on the device:
25369  - PLIB_SPI_OutputDataPhaseSelect
25370  This operation is atomic.
25371  Preconditions:
25372  None.
25373  Parameters:
25374  index - Identifier for the device instance
25375  Returns:
25376  - true - The OutputDataPhase feature is supported on the device
25377  - false - The OutputDataPhase feature is not supported on the device
25378  Remarks:
25379  None.
25380 */
25381 
25382 bool
25384  SPI_MODULE_ID index ) ;
25385 //******************************************************************************
25386 /* Function:
25387  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25388  Summary:
25389  Identifies whether the ClockPolarity feature exists on the SPI module.
25390  Description:
25391  This function identifies whether the ClockPolarity feature is available on
25392  the SPI module.
25393  When this function returns true, this function is supported on the device:
25394  - PLIB_SPI_ClockPolaritySelect
25395  This operation is atomic.
25396  Preconditions:
25397  None.
25398  Parameters:
25399  index - Identifier for the device instance
25400  Returns:
25401  - true - The ClockPolarity feature is supported on the device
25402  - false - The ClockPolarity feature is not supported on the device
25403  Remarks:
25404  None.
25405 */
25406 
25407 bool
25409  SPI_MODULE_ID index ) ;
25410 //******************************************************************************
25411 /* Function:
25412  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25413  Summary:
25414  Identifies whether the MasterControl feature exists on the SPI module.
25415  Description:
25416  This function identifies whether the MasterControl feature is available on
25417  the SPI module.
25418  When this function returns true, these functions are supported on the device:
25419  - PLIB_SPI_MasterEnable
25420  - PLIB_SPI_SlaveEnable
25421  This operation is atomic.
25422  Preconditions:
25423  None.
25424  Parameters:
25425  index - Identifier for the device instance
25426  Returns:
25427  - true - The MasterControl feature is supported on the device
25428  - false - The MasterControl feature is not supported on the device
25429  Remarks:
25430  None.
25431 */
25432 
25433 bool
25435  SPI_MODULE_ID index ) ;
25436 //******************************************************************************
25437 /* Function:
25438  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25439  Summary:
25440  Identifies whether the BaudRate feature exists on the SPI module.
25441  Description:
25442  This function identifies whether the BaudRate feature is available on the SPI
25443  module.
25444  When this function returns true, this function is supported on the device:
25445  - PLIB_SPI_BaudRateSet
25446  This operation is atomic.
25447  Preconditions:
25448  None.
25449  Parameters:
25450  index - Identifier for the device instance
25451  Returns:
25452  - true - The BaudRate feature is supported on the device
25453  - false - The BaudRate feature is not supported on the device
25454  Remarks:
25455  None.
25456 */
25457 
25458 bool
25460  SPI_MODULE_ID index ) ;
25461 //******************************************************************************
25462 /* Function:
25463  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25464  Summary:
25465  Identifies whether the BusStatus feature exists on the SPI module.
25466  Description:
25467  This function identifies whether the BusStatus feature is available on the
25468  SPI module.
25469  When this function returns true, this function is supported on the device:
25470  - PLIB_SPI_IsBusy
25471  This operation is atomic.
25472  Preconditions:
25473  None.
25474  Parameters:
25475  index - Identifier for the device instance
25476  Returns:
25477  - true - The BusStatus feature is supported on the device
25478  - false - The BusStatus feature is not supported on the device
25479  Remarks:
25480  None.
25481 */
25482 
25483 bool
25485  SPI_MODULE_ID index ) ;
25486 //******************************************************************************
25487 /* Function:
25488  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25489  Summary:
25490  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25491  Description:
25492  This function identifies whether the ReadDataSignStatus feature is available
25493  on the SPI module.
25494  When this function returns true, this function is supported on the device:
25495  - PLIB_SPI_ReadDataIsSignExtended
25496  This operation is atomic.
25497  Preconditions:
25498  None.
25499  Parameters:
25500  index - Identifier for the device instance
25501  Returns:
25502  - true - The ReadDataSignStatus feature is supported on the device
25503  - false - The ReadDataSignStatus feature is not supported on the device
25504  Remarks:
25505  None.
25506 */
25507 
25508 bool
25510  SPI_MODULE_ID index ) ;
25511 //******************************************************************************
25512 /* Function:
25513  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25514  Summary:
25515  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25516  Description:
25517  This function identifies whether the SlaveSelectControl feature is available
25518  on the SPI module.
25519  When this function returns true, these functions are supported on the device:
25520  - PLIB_SPI_SlaveSelectEnable
25521  - PLIB_SPI_SlaveSelectDisable
25522  This operation is atomic.
25523  Preconditions:
25524  None.
25525  Parameters:
25526  index - Identifier for the device instance
25527  Returns:
25528  - true - The SlaveSelectControl feature is supported on the device
25529  - false - The SlaveSelectControl feature is not supported on the device
25530  Remarks:
25531  None.
25532 */
25533 
25534 bool
25536  SPI_MODULE_ID index ) ;
25537 //******************************************************************************
25538 /* Function:
25539  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
25540  Summary:
25541  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
25542  Description:
25543  This function identifies whether the TransmitUnderRunStatus feature is available
25544  on the SPI module.
25545  When this function returns true, these functions are supported on the device:
25546  - PLIB_SPI_TransmitUnderRunStatusGet
25547  - PLIB_SPI_TransmitUnderRunStatusClear
25548  This operation is atomic.
25549  Preconditions:
25550  None.
25551  Parameters:
25552  index - Identifier for the device instance
25553  Returns:
25554  - true - The TransmitUnderRunStatus feature is supported on the device
25555  - false - The TransmitUnderRunStatus feature is not supported on the device
25556  Remarks:
25557  None.
25558 */
25559 
25560 bool
25562  SPI_MODULE_ID index ) ;
25563 //******************************************************************************
25564 /* Function:
25565  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
25566  Summary:
25567  Identifies whether the FIFOControl feature exists on the SPI module.
25568  Description:
25569  This function identifies whether the FIFOControl feature is available on the
25570  SPI module.
25571  When this function returns true, these functions are supported on the device:
25572  - PLIB_SPI_FIFOEnable
25573  - PLIB_SPI_FIFODisable
25574  This operation is atomic.
25575  Preconditions:
25576  None.
25577  Parameters:
25578  index - Identifier for the device instance
25579  Returns:
25580  - true - The FIFOControl feature is supported on the device
25581  - false - The FIFOControl feature is not supported on the device
25582  Remarks:
25583  None.
25584 */
25585 
25586 bool
25588  SPI_MODULE_ID index ) ;
25589 //******************************************************************************
25590 /* Function:
25591  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
25592  Summary:
25593  Identifies whether the FIFOCount feature exists on the SPI module.
25594  Description:
25595  This function identifies whether the FIFOCount feature is available on the SPI module.
25596  When this function returns true, this function is supported on the device:
25597  - PLIB_SPI_FIFOCountGet
25598  This operation is atomic.
25599  Preconditions:
25600  None.
25601  Parameters:
25602  index - Identifier for the device instance
25603  Returns:
25604  - true - The FIFOCount feature is supported on the device
25605  - false - The FIFOCount feature is not supported on the device
25606  Remarks:
25607  None.
25608 */
25609 
25610 bool
25612  SPI_MODULE_ID index ) ;
25613 //******************************************************************************
25614 /* Function:
25615  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
25616  Summary:
25617  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
25618  Description:
25619  This function identifies whether the ReceiveFIFOStatus feature is available
25620  on the SPI module.
25621  When this function returns true, this function is supported on the device:
25622  - PLIB_SPI_ReceiverFIFOIsEmpty
25623  This operation is atomic.
25624  Preconditions:
25625  None.
25626  Parameters:
25627  index - Identifier for the device instance
25628  Returns:
25629  - true - The ReceiveFIFOStatus feature is supported on the device
25630  - false - The ReceiveFIFOStatus feature is not supported on the device
25631  Remarks:
25632  None.
25633 */
25634 
25635 bool
25637  SPI_MODULE_ID index ) ;
25638 //******************************************************************************
25639 /* Function:
25640  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
25641  Summary:
25642  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
25643  Description:
25644  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
25645  available on the SPI module.
25646  When this function returns true, this function is supported on the device:
25647  - PLIB_SPI_FIFOShiftRegisterIsEmpty
25648  This operation is atomic.
25649  Preconditions:
25650  None.
25651  Parameters:
25652  index - Identifier for the device instance
25653  Returns:
25654  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
25655  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
25656  Remarks:
25657  None.
25658 */
25659 
25660 bool
25662  SPI_MODULE_ID index ) ;
25663 //******************************************************************************
25664 /* Function:
25665  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
25666  Summary:
25667  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
25668  Description:
25669  This function identifies whether the FIFOInterruptMode feature is available
25670  on the SPI module.
25671  When this function returns true, this function is supported on the device:
25672  - PLIB_SPI_FIFOInterruptModeSelect
25673  This operation is atomic.
25674  Preconditions:
25675  None.
25676  Parameters:
25677  index - Identifier for the device instance
25678  Returns:
25679  - true - The FIFOInterruptMode feature is supported on the device
25680  - false - The FIFOInterruptMode feature is not supported on the device
25681  Remarks:
25682  None.
25683 */
25684 
25685 bool
25687  SPI_MODULE_ID index ) ;
25688 //******************************************************************************
25689 /* Function:
25690  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
25691  Summary:
25692  Identifies whether the FramedCommunication feature exists on the SPI module.
25693  Description:
25694  This function identifies whether the FramedCommunication feature is available
25695  on the SPI module.
25696  When this function returns true, these functions are supported on the device:
25697  - PLIB_SPI_FramedCommunicationEnable
25698  - PLIB_SPI_FramedCommunicationDisable
25699  This operation is atomic.
25700  Preconditions:
25701  None.
25702  Parameters:
25703  index - Identifier for the device instance
25704  Returns:
25705  - true - The FramedCommunication feature is supported on the device
25706  - false - The FramedCommunication feature is not supported on the device
25707  Remarks:
25708  None.
25709 */
25710 
25711 bool
25713  SPI_MODULE_ID index ) ;
25714 //******************************************************************************
25715 /* Function:
25716  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
25717  Summary:
25718  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
25719  Description:
25720  This function identifies whether the FrameSyncPulseDirection feature is available
25721  on the SPI module.
25722  When this function returns true, this function is supported on the device:
25723  - PLIB_SPI_FrameSyncPulseDirectionSelect
25724  This operation is atomic.
25725  Preconditions:
25726  None.
25727  Parameters:
25728  index - Identifier for the device instance
25729  Returns:
25730  - true - The FrameSyncPulseDirection feature is supported on the device
25731  - false - The FrameSyncPulseDirection feature is not supported on the device
25732  Remarks:
25733  None.
25734 */
25735 
25736 bool
25738  SPI_MODULE_ID index ) ;
25739 //******************************************************************************
25740 /* Function:
25741  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
25742  Summary:
25743  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
25744  Description:
25745  This function identifies whether the FrameSyncPulsePolarity feature is available
25746  on the SPI module.
25747  When this function returns true, this function is supported on the device:
25748  - PLIB_SPI_FrameSyncPulsePolaritySelect
25749  This operation is atomic.
25750  Preconditions:
25751  None.
25752  Parameters:
25753  index - Identifier for the device instance
25754  Returns:
25755  - true - The FrameSyncPulsePolarity feature is supported on the device
25756  - false - The FrameSyncPulsePolarity feature is not supported on the device
25757  Remarks:
25758  None.
25759 */
25760 
25761 bool
25763  SPI_MODULE_ID index ) ;
25764 //******************************************************************************
25765 /* Function:
25766  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
25767  Summary:
25768  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
25769  Description:
25770  This function identifies whether the FrameSyncPulseEdge feature is available
25771  on the SPI module.
25772  When this function returns true, this function is supported on the device:
25773  - PLIB_SPI_FrameSyncPulseEdgeSelect
25774  This operation is atomic.
25775  Preconditions:
25776  None.
25777  Parameters:
25778  index - Identifier for the device instance
25779  Returns:
25780  - true - The FrameSyncPulseEdge feature is supported on the device
25781  - false - The FrameSyncPulseEdge feature is not supported on the device
25782  Remarks:
25783  None.
25784 */
25785 
25786 bool
25788  SPI_MODULE_ID index ) ;
25789 //******************************************************************************
25790 /* Function:
25791  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
25792  Summary:
25793  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
25794  Description:
25795  This function identifies whether the FrameSyncPulseWidth feature is available
25796  on the SPI module.
25797  When this function returns true, this function is supported on the device:
25798  - PLIB_SPI_FrameSyncPulseWidthSelect
25799  This operation is atomic.
25800  Preconditions:
25801  None.
25802  Parameters:
25803  index - Identifier for the device instance
25804  Returns:
25805  - true - The FrameSyncPulseWidth feature is supported on the device
25806  - false - The FrameSyncPulseWidth feature is not supported on the device
25807  Remarks:
25808  None.
25809 */
25810 
25811 bool
25813  SPI_MODULE_ID index ) ;
25814 //******************************************************************************
25815 /* Function:
25816  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
25817  Summary:
25818  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
25819  Description:
25820  This function identifies whether the FrameSyncPulseCounter feature is available
25821  on the SPI module.
25822  When this function returns true, this function is supported on the device:
25823  - PLIB_SPI_FrameSyncPulseCounterSelect
25824  This operation is atomic.
25825  Preconditions:
25826  None.
25827  Parameters:
25828  index - Identifier for the device instance
25829  Returns:
25830  - true - The FrameSyncPulseCounter feature is supported on the device
25831  - false - The FrameSyncPulseCounter feature is not supported on the device
25832  Remarks:
25833  None.
25834 */
25835 
25836 bool
25838  SPI_MODULE_ID index ) ;
25839 //******************************************************************************
25840 /* Function:
25841  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
25842  Summary:
25843  Identifies whether the FrameErrorStatus feature exists on the SPI module.
25844  Description:
25845  This function identifies whether the FrameErrorStatus feature is available on
25846  the SPI module.
25847  When this function returns true, these functions are supported on the device:
25848  - PLIB_SPI_FrameErrorStatusGet
25849  - PLIB_SPI_FrameErrorStatusClear
25850  This operation is atomic.
25851  Preconditions:
25852  None.
25853  Parameters:
25854  index - Identifier for the device instance
25855  Returns:
25856  - true - The FrameErrorStatus feature is supported on the device
25857  - false - The FrameErrorStatus feature is not supported on the device
25858  Remarks:
25859  None.
25860 */
25861 
25862 bool
25864  SPI_MODULE_ID index ) ;
25865 //******************************************************************************
25866 /* Function:
25867  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
25868  Summary:
25869  Identifies whether the Buffer feature exists on the SPI module.
25870  Description:
25871  This function identifies whether the Buffer feature is available on the SPI module.
25872  When this function returns true, these functions are supported on the device:
25873  - PLIB_SPI_BufferClear
25874  - PLIB_SPI_BufferRead
25875  - PLIB_SPI_BufferWrite
25876  - PLIB_SPI_BufferAddressGet
25877  This operation is atomic.
25878  Preconditions:
25879  None.
25880  Parameters:
25881  index - Identifier for the device instance
25882  Returns:
25883  - true - The Buffer feature is supported on the device
25884  - false - The Buffer feature is not supported on the device
25885  Remarks:
25886  None.
25887 */
25888 
25889 bool
25891  SPI_MODULE_ID index ) ;
25892 //******************************************************************************
25893 /* Function:
25894  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
25895  Summary:
25896  Identifies whether the BaudRateClock feature exists on the SPI module.
25897  Description:
25898  This function identifies whether the BaudRateClock feature is available on
25899  the SPI module.
25900  When this function returns true, this function is supported on the device:
25901  - PLIB_SPI_BaudRateClockSelect
25902  This operation is atomic.
25903  Preconditions:
25904  None.
25905  Parameters:
25906  index - Identifier for the device instance
25907  Returns:
25908  - true - The BaudRateClock feature is supported on the device
25909  - false - The BaudRateClock feature is not supported on the device
25910  Remarks:
25911  None.
25912 */
25913 
25914 bool
25916  SPI_MODULE_ID index ) ;
25917 //******************************************************************************
25918 /* Function:
25919  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
25920  Summary:
25921  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
25922  Description:
25923  This function identifies whether the ErrorInterruptControl feature is available
25924  on the SPI module.
25925  When this function returns true, these functions are supported on the device:
25926  - PLIB_SPI_ErrorInterruptEnable
25927  - PLIB_SPI_ErrorInterruptDisable
25928  This operation is atomic.
25929  Preconditions:
25930  None.
25931  Parameters:
25932  index - Identifier for the device instance
25933  Returns:
25934  - true - The ErrorInterruptControl feature is supported on the device
25935  - false - The ErrorInterruptControl feature is not supported on the device
25936  Remarks:
25937  None.
25938 */
25939 
25940 bool
25942  SPI_MODULE_ID index ) ;
25943 //******************************************************************************
25944 /* Function:
25945  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
25946  Summary:
25947  Identifies whether the AudioErrorControl feature exists on the SPI module.
25948  Description:
25949  This function identifies whether the AudioErrorControl feature is available
25950  on the SPI module.
25951  When this function returns true, these functions are supported on the device:
25952  - PLIB_SPI_AudioErrorEnable
25953  - PLIB_SPI_AudioErrorDisable
25954  This operation is atomic.
25955  Preconditions:
25956  None.
25957  Parameters:
25958  index - Identifier for the device instance
25959  Returns:
25960  - true - The AudioErrorControl feature is supported on the device
25961  - false - The AudioErrorControl feature is not supported on the device
25962  Remarks:
25963  None.
25964 */
25965 
25966 bool
25968  SPI_MODULE_ID index ) ;
25969 //******************************************************************************
25970 /* Function:
25971  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
25972  Summary:
25973  Identifies whether the AudioProtocolControl feature exists on the SPI module.
25974  Description:
25975  This function identifies whether the AudioProtocolControl feature is available
25976  on the SPI module.
25977  When this function returns true, this function is supported on the device:
25978  - PLIB_SPI_AudioProtocolEnable
25979  - PLIB_SPI_AudioProtocolDisable
25980  This operation is atomic.
25981  Preconditions:
25982  None.
25983  Parameters:
25984  index - Identifier for the device instance
25985  Returns:
25986  - true - The AudioProtocolControl feature is supported on the device
25987  - false - The AudioProtocolControl feature is not supported on the device
25988  Remarks:
25989  None.
25990 */
25991 
25992 bool
25994  SPI_MODULE_ID index ) ;
25995 //******************************************************************************
25996 /* Function:
25997  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
25998  Summary:
25999  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26000  Description:
26001  This function identifies whether the AudioTransmitMode feature is available
26002  on the SPI module.
26003  When this function returns true, this function is supported on the device:
26004  - PLIB_SPI_AudioTransmitModeSelect
26005  This operation is atomic.
26006  Preconditions:
26007  None.
26008  Parameters:
26009  index - Identifier for the device instance
26010  Returns:
26011  - true - The AudioTransmitMode feature is supported on the device
26012  - false - The AudioTransmitMode feature is not supported on the device
26013  Remarks:
26014  None.
26015 */
26016 
26017 bool
26019  SPI_MODULE_ID index ) ;
26020 //******************************************************************************
26021 /* Function:
26022  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26023  Summary:
26024  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26025  Description:
26026  This function identifies whether the AudioProtocolMode feature is available
26027  on the SPI module.
26028  When this function returns true, this function is supported on the device:
26029  - PLIB_SPI_AudioProtocolModeSelect
26030  This operation is atomic.
26031  Preconditions:
26032  None.
26033  Parameters:
26034  index - Identifier for the device instance
26035  Returns:
26036  - true - The AudioProtocolMode feature is supported on the device
26037  - false - The AudioProtocolMode feature is not supported on the device
26038  Remarks:
26039  None.
26040 */
26041 
26042 bool
26044  SPI_MODULE_ID index ) ;
26045 //******************************************************************************
26046 /* Function:
26047  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26048  Summary:
26049  Identifies whether the Buffer32bit feature exists on the SPI module.
26050  Description:
26051  This function identifies whether the Buffer32bit feature is available on the
26052  SPI module.
26053  When this function returns true, these functions are supported on the device:
26054  - PLIB_SPI_BufferRead32bit
26055  - PLIB_SPI_BufferWrite32bit
26056  This operation is atomic.
26057  Preconditions:
26058  None.
26059  Parameters:
26060  index - Identifier for the device instance
26061  Returns:
26062  - true - The Buffer32bit feature is supported on the device
26063  - false - The Buffer32bit feature is not supported on the device
26064  Remarks:
26065  None.
26066 */
26067 
26068 bool
26070  SPI_MODULE_ID index ) ;
26071 //******************************************************************************
26072 /* Function:
26073  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26074  Summary:
26075  Identifies whether the Buffer16bit feature exists on the SPI module.
26076  Description:
26077  This function identifies whether the Buffer16bit feature is available on the
26078  SPI module.
26079  When this function returns true, these functions are supported on the device:
26080  - PLIB_SPI_BufferRead16bit
26081  - PLIB_SPI_BufferWrite16bit
26082  This operation is atomic.
26083  Preconditions:
26084  None.
26085  Parameters:
26086  index - Identifier for the device instance
26087  Returns:
26088  - true - The Buffer16bit feature is supported on the device
26089  - false - The Buffer16bit feature is not supported on the device
26090  Remarks:
26091  None.
26092 */
26093 
26094 bool
26096  SPI_MODULE_ID index ) ;
26097 //DOM-IGNORE-BEGIN
26098 //DOM-IGNORE-END
26099  // #ifndef _PLIB_SPI_H
26100 /*******************************************************************************
26101  End of File
26102  */
26103 
26104 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26105 /* CLOSE_FILE Include File */
26106 
26107  // SPI PLIB Header
26108 #include "system/common/sys_common.h" // Common System Service Definitions
26109 #include "system/common/sys_module.h" // Module/Driver Definitions
26110 #include "system/int/sys_int.h" // System Interrupt Definitions
26111 #include "system/clk/sys_clk.h"
26112 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26113  /* LDRA full path */
26114 // DOM-IGNORE-BEGIN
26115 // DOM-IGNORE-END
26116 // *****************************************************************************
26117 /* SPI Driver Buffer Handle
26118  Summary:
26119  Handle identifying a read or write buffer passed to the driver.
26120  Description:
26121  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26122  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26123  This handle is associated with the buffer passed into the function and
26124  it allows the application to track the completion of the data from (or into)
26125  that buffer. The buffer handle value returned from the "buffer add" function
26126  is returned back to the client by the "callback" function registered with
26127  the driver.
26128  The buffer handle assigned to a client request expires when the client has
26129  been notified of the completion of the buffer transfer (after event handler
26130  function that notifies the client returns) or after the buffer has been
26131  retired by the driver if no event handler callback was set.
26132  Remarks:
26133  None.
26134 */
26135 
26136 typedef
26137 uintptr_t
26139 // *****************************************************************************
26140 /* SPI Driver Invalid Buffer Handle
26141  Summary:
26142  Definition of an invalid buffer handle.
26143  Description:
26144  This is the definition of an invalid buffer handle. An invalid buffer handle
26145  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26146  function if the buffer add request was not successful.
26147  Remarks:
26148  None.
26149 */
26150 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26151 // *****************************************************************************
26152 /* SPI Driver Module Index Numbers
26153  Summary:
26154  SPI driver index definitions.
26155  Description:
26156  These constants provide the SPI driver index definitions.
26157  Remarks:
26158  These constants should be used in place of hard-coded numeric literals.
26159  These values should be passed into the DRV_SPI_Initialize and
26160  DRV_SPI_Open functions to identify the driver instance in use.
26161 */
26162 #define DRV_SPI_INDEX_0 0
26163 #define DRV_SPI_INDEX_1 1
26164 #define DRV_SPI_INDEX_2 2
26165 #define DRV_SPI_INDEX_3 3
26166 #define DRV_SPI_INDEX_4 4
26167 #define DRV_SPI_INDEX_5 5
26168 // *****************************************************************************
26169 /* SPI Driver Module Index Count
26170  Summary:
26171  Number of valid SPI driver indices.
26172  Description:
26173  This constant identifies the number of valid SPI driver indices.
26174  Remarks:
26175  This constant should be used in place of hard-coded numeric literals.
26176  This value is derived from device-specific header files defined as part
26177  of the peripheral libraries.
26178 */
26179 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26180 // *****************************************************************************
26181 /* SPI Clock Mode Selection
26182  Summary:
26183  Identifies the various clock modes of the SPI module.
26184  Description:
26185  This enumeration identifies the various clock modes of the SPI module.
26186  Remarks:
26187  None.
26188 */
26189 
26190 typedef
26191  enum
26192  {
26193  /* SPI Clock Mode 0:
26194  - Idle State of the clock is Low
26195  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26196  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26198  /*DOM-IGNORE-BEGIN*/
26199  = 0 /*DOM-IGNORE-END*/
26200  ,
26201  /* SPI Clock Mode 1:
26202  - Idle State of the clock is Low
26203  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26204  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26206  /*DOM-IGNORE-BEGIN*/
26207  = 1 /*DOM-IGNORE-END*/
26208  ,
26209  /* SPI Clock Mode 2:
26210  - Idle State of the clock is High
26211  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26212  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26214  /*DOM-IGNORE-BEGIN*/
26215  = 2 /*DOM-IGNORE-END*/
26216  ,
26217  /* SPI Clock Mode 3:
26218  - Idle State of the clock is High
26219  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26220  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26222  /*DOM-IGNORE-BEGIN*/
26223  = 3 /*DOM-IGNORE-END*/
26224  } DRV_SPI_CLOCK_MODE ;
26225 // *****************************************************************************
26226 /* SPI Buffer Type Selection
26227  Summary:
26228  Identifies the various buffer types of the SPI module.
26229  Description:
26230  This enumeration identifies the various buffer types of the SPI module.
26231  Remarks:
26232  None.
26233 */
26234 
26235 typedef
26236  enum
26237  {
26238  /* SPI Buffer Type Standard */
26240  /*DOM-IGNORE-BEGIN*/
26241  = 0 /*DOM-IGNORE-END*/
26242  ,
26243  /* SPI Enhanced Buffer Type */
26245  /*DOM-IGNORE-BEGIN*/
26246  = 1 /*DOM-IGNORE-END*/
26248 // *****************************************************************************
26249 /* SPI Protocols Enumeration
26250  Summary:
26251  Identifies the various protocols of the SPI module.
26252  Description:
26253  This enumeration identifies the various protocols of the SPI module.
26254  Remarks:
26255  None.
26256 */
26257 
26258 typedef
26259  enum
26260  {
26261  /* SPI Protocol Type Standard */
26263  /*DOM-IGNORE-BEGIN*/
26264  = 0 /*DOM-IGNORE-END*/
26265  ,
26266  /* SPI Protocol Type Framed */
26268  /*DOM-IGNORE-BEGIN*/
26269  = 1 /*DOM-IGNORE-END*/
26270  ,
26271  /*SPI Protocol Type Audio*/
26273  /*DOM-IGNORE-BEGIN*/
26274  = 2 /*DOM-IGNORE-END*/
26276 // *****************************************************************************
26277 /* SPI Driver Buffer Events
26278  Summary
26279  Identifies the possible events that can result from a buffer add request.
26280  Description
26281  This enumeration identifies the possible events that can result from a
26282  buffer add request caused by the client calling either
26283  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26284  Remarks:
26285  One of these values is passed in the "event" parameter of the event
26286  handling callback function that the client registered during buffer add
26287  requests.
26288 */
26289 
26290 typedef
26291  enum
26292  {
26293  /* Buffer is pending to get processed */
26295  /* Buffer is being processed */
26297  /* All data from or to the buffer was transferred successfully. */
26299  /* There was an error while processing the buffer transfer request. */
26302 // *****************************************************************************
26303 /* SPI Usage Modes Enumeration
26304  Summary:
26305  Identifies the various usage modes of the SPI module.
26306  Description:
26307  This enumeration identifies the various usage modes of the SPI module.
26308  Remarks:
26309  None.
26310 */
26311 
26312 typedef
26313  enum
26314  {
26315  /* SPI Mode Master */
26317  /*DOM-IGNORE-BEGIN*/
26318  = 0 /*DOM-IGNORE-END*/
26319  ,
26320  /* SPI Mode Slave */
26322  /*DOM-IGNORE-BEGIN*/
26323  = 1 /*DOM-IGNORE-END*/
26324  } DRV_SPI_MODE ;
26325 // *****************************************************************************
26326 /* SPI Task Modes Enumeration
26327  Summary:
26328  Identifies the various modes of how the tasks function will be run.
26329  Description:
26330  This enumeration identifies the various tasks mode
26331  Remarks:
26332  None.
26333 */
26334 
26335 typedef
26336  enum
26337  {
26338  /* Task is configured to run in polled mode */
26340  /*DOM-IGNORE-BEGIN*/
26341  = 0 /*DOM-IGNORE-END*/
26342  ,
26343  /* Task is configured to run in interrupt mode */
26345  /*DOM-IGNORE-BEGIN*/
26346  = 1 /*DOM-IGNORE-END*/
26347  } DRV_SPI_TASK_MODE ;
26348 // *****************************************************************************
26349 /* SPI Driver Buffer Event Handler Function Pointer
26350  Summary:
26351  Pointer to a SPI Driver Buffer Event handler function
26352  Description:
26353  This data type defines the required function signature for the SPI driver
26354  buffer event handling callback function. A client must register a pointer
26355  to a buffer event handling function who's function signature (parameter
26356  and return value types) match the types specified by this function pointer
26357  in order to receive buffer related event calls back from the driver.
26358  The parameters and return values and return value are described here and
26359  a partial example implementation is provided.
26360  Parameters:
26361  event - Identifies the type of event
26362  bufferHandle - Handle identifying the buffer to which the vent relates
26363  context - Value identifying the context of the application that
26364  registered the event handling function.
26365  Returns:
26366  None.
26367  Example:
26368  <code>
26369  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26370  DRV_SPI_BUFFER_HANDLE bufferHandle,
26371  uintptr_t context )
26372  {
26373  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26374  switch(event)
26375  {
26376  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26377  // Handle the completed buffer.
26378  break;
26379  case DRV_SPI_BUFFER_EVENT_ERROR:
26380  default:
26381  // Handle error.
26382  break;
26383  }
26384  }
26385  </code>
26386  Remarks:
26387  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26388  transferred successfully.
26389  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26390  not transferred successfully.
26391  The bufferHandle parameter contains the buffer handle of the buffer that
26392  failed.
26393  The context parameter contains the a handle to the client context,
26394  provided at the time the event handling function registration.
26395  This context handle value is passed back to the client as the "context"
26396  parameter. It can be any value necessary to identify the client context
26397  or instance (such as a pointer to the client's data) instance of the
26398  client that made the buffer add request.
26399  The event handler function executes in an interrupt context when the driver
26400  is configured for interrupt mode operation. It is recommended of the
26401  application to not perform process intensive operations with in this
26402  function.
26403 */
26404 
26405 typedef
26407 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26408 void * context ) ;
26409 // *****************************************************************************
26410 /* SPI Driver Initialization Data
26411  Summary:
26412  Defines the data required to initialize or reinitialize the SPI driver
26413  Description:
26414  This data type defines the data required to initialize or reinitialize the
26415  SPI driver. If the driver is built statically, the members of this data
26416  structure are statically over-ridden by static override definitions in the
26417  system_config.h file.
26418  Remarks:
26419  None.
26420 */
26421 
26422 typedef
26423 struct _DRV_SPI_INIT
26424 {
26425  /* System module initialization */
26426  SYS_MODULE_INIT moduleInit ;
26427  /* Identifies peripheral (PLIB-level) ID */
26428  SPI_MODULE_ID spiId ;
26429  /* SPI Task Mode Type*/
26431  /* SPI Usage Mode Type */
26433  /* Allow SPI to run when CPU goes to idle mode*/
26434  bool allowIdleRun ;
26435  /* SPI Protocol Type */
26437  /* SPI Slave Mode SSx Pin Select */
26438  bool spiSlaveSSPin ;
26439  /* Framed mode Sync Pulse*/
26440  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26441  /* Framed Mode pulse polarity*/
26442  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26443  /* Framed Mode Pulse Direction*/
26444  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26445  /* Framed mode Pulse Edge*/
26446  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26447  /* Framed Mode Pulse width */
26448  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26449  /* Audio mode transmit mode*/
26450  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26451  /* Audio mode protocol mode*/
26452  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26453  /* Communication Width */
26454  SPI_COMMUNICATION_WIDTH commWidth ;
26455  /* SPI clock source which generates required baud rate.
26456  It can be either PBCLK or Reference Clock */
26457  SPI_BAUD_RATE_CLOCK baudClockSource ;
26458  /* when Baud rate clock source is peripheral clock, then this element is
26459  used to define which peripheral bus clock is used for this particular
26460  SPI instance. */
26461  CLK_BUSES_PERIPHERAL spiClk ;
26462  /* Baud Rate Value */
26463  uint32_t baudRate ;
26464  /* SPI Buffer Type */
26466  /* SPI Clock mode */
26468  /* SPI Input Sample Phase Selection */
26469  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26470  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26471  INT_SOURCE txInterruptSource ;
26472  /* Receive Interrupt Source for SPI module */
26473  INT_SOURCE rxInterruptSource ;
26474  /* Error Interrupt Source for SPI module */
26475  INT_SOURCE errInterruptSource ;
26476  /* While using standard buffer and polled mode how many transfers to do
26477  before yielding to other tasks*/
26478  uint8_t numTrfsSmPolled ;
26479  /* Dummy byte value which will be used for dummy transmission */
26480  uint32_t dummyByteValue ;
26481  /* This is the buffer queue size. This is the maximum
26482  number of transfer requests that driver will queue. */
26483  uint8_t queueSize ;
26484  /* This controls the minimum number of jobs that the driver will be able
26485  to accept without running out of memory. The driver will reserve this
26486  number of jobs from the global SPI queue so that it will always be available*/
26487  uint8_t jobQueueReserveSize ;
26488  /* This callback is fired when an operation is about to start on the
26489  SPI bus. This allows the user to set any pins that need to be set.
26490  This callback may be called from an ISR so should not include OSAL
26491  calls. The context parameter is the same one passed into the
26492  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26493  */
26495  /* This callback is fired when an operation has just completed on the
26496  SPI bus. This allows the user to set any pins that need to be set.
26497  This callback may be called from an ISR so should not include OSAL
26498  calls. The context parameter is the same one passed into the
26499  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26500  */
26502 } DRV_SPI_INIT ;
26503 // *****************************************************************************
26504 /* SPI Driver Client Specific Configuration
26505  Summary:
26506  Defines the data that can be changed per client.
26507  Description:
26508  This data type defines the data can be configured per client. This data can
26509  be per client, and overrides the configuration data contained inside of
26510  DRV_SPI_INIT.
26511  Remarks:
26512  None.
26513 */
26514 
26515 typedef
26516 struct _DRV_SPI_CLIENT_DATA
26517 {
26518  /* Baud Rate Value */
26519  uint32_t baudRate ;
26520  /* This callback is fired when an operation is about to start on the
26521  SPI bus. This allows the user to set any pins that need to be set.
26522  This callback may be called from an ISR so should not include OSAL
26523  calls. The context parameter is the same one passed into the
26524  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26525  */
26527  /* This callback is fired when an operation has just completed on the
26528  SPI bus. This allows the user to set any pins that need to be set.
26529  This callback may be called from an ISR so should not include OSAL
26530  calls. The context parameter is the same one passed into the
26531  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26532  */
26535 //DOM-IGNORE-BEGIN
26536 //DOM-IGNORE-END
26537  // #ifndef _DRV_SPI_DEFINITIONS_H
26538 /*******************************************************************************
26539  End of File
26540 */
26541 
26542 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
26543 /* CLOSE_FILE Include File */
26544 
26545 // DOM-IGNORE-BEGIN
26546 // DOM-IGNORE-END
26547 // *****************************************************************************
26548 // *****************************************************************************
26549 // Section: Interface Routines - System Level
26550 // *****************************************************************************
26551 // *****************************************************************************
26552 // *****************************************************************************
26553 /* Function:
26554  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
26555  const SYS_MODULE_INIT * const init )
26556  Summary:
26557  Initializes the SPI instance for the specified driver index.
26558  <p><b>Implementation:</b> Static/Dynamic</p>
26559  Description:
26560  This routine initializes the SPI driver instance for the specified driver
26561  index, making it ready for clients to open and use it. The initialization
26562  data is specified by the 'init' parameter. The initialization may fail if the
26563  number of driver objects allocated are insufficient or if the specified
26564  driver instance is already initialized. The driver instance index is
26565  independent of the SPI module ID. For example, driver instance 0 can be
26566  assigned to SPI2. If the driver is built statically, then some of the
26567  initialization parameters are overridden by configuration macros. Refer to
26568  the description of the DRV_SPI_INIT data structure for more details on
26569  which members on this data structure are overridden.
26570  Precondition:
26571  None.
26572  Parameters:
26573  index - Identifier for the instance to be initialized. Please note this
26574  is not the SPI id. The hardware SPI id is set in the initialization
26575  structure. This is the index of the driver index to use.
26576  init - Pointer to a data structure containing any data necessary to
26577  initialize the driver. If this pointer is NULL, the driver
26578  uses the static initialization override macros for each
26579  member of the initialization data structure.
26580  Returns:
26581  - If successful - returns a valid handle to a driver instance object
26582  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
26583  Example:
26584  <code>
26585  DRV_SPI_INIT init;
26586  SYS_MODULE_OBJ objectHandle;
26587  // Populate the SPI initialization structure
26588  init.spiId = SPI_ID_1,
26589  init.taskMode = DRV_SPI_TASK_MODE_ISR,
26590  init.spiMode = DRV_SPI_MODE_MASTER,
26591  init.allowIdleRun = false,
26592  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
26593  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
26594  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
26595  init.spiClk = CLK_BUS_PERIPHERAL_2,
26596  init.baudRate = 10000000,
26597  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
26598  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
26599  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
26600  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
26601  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
26602  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
26603  init.dummyByteValue = 0xFF,
26604  init.queueSize = 10,
26605  init.jobQueueReserveSize = 1,
26606  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
26607  if (SYS_MODULE_OBJ_INVALID == objectHandle)
26608  {
26609  // Handle error
26610  }
26611  </code>
26612  Remarks:
26613  This routine must be called before any other SPI routine is called.
26614  This routine should only be called once during system initialization
26615  unless DRV_SPI_Deinitialize is called to deinitialize the driver
26616  instance. This routine will NEVER block for hardware access.
26617 */
26618 
26619 SYS_MODULE_OBJ
26621  const SYS_MODULE_INDEX index ,
26622  const SYS_MODULE_INIT * const init ) ;
26623 //*************************************************************************
26624 /* Function:
26625  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
26626  Summary:
26627  Deinitializes the specified instance of the SPI driver module.
26628  <p><b>Implementation:</b> Static/Dynamic</p>
26629  Description:
26630  Deinitializes the specified instance of the SPI driver module,
26631  disabling its operation (and any hardware) and invalidates all of the
26632  internal data.
26633  Precondition:
26634  Function DRV_SPI_Initialize must have been called before calling this
26635  routine and a valid SYS_MODULE_OBJ must have been returned.
26636  Parameters:
26637  object - Driver object handle, returned from DRV_SPI_Initialize
26638  Returns:
26639  None.
26640  Example:
26641  <code>
26642  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26643  SYS_STATUS status;
26644  DRV_SPI_Deinitialize ( object );
26645  status = DRV_SPI_Status( object );
26646  if( SYS_MODULE_UNINITIALIZED == status )
26647  {
26648  // Check again later if you need to know
26649  // when the driver is deinitialized.
26650  }
26651  </code>
26652  Remarks:
26653  Once the Initialize operation has been called, the De-initialize
26654  operation must be called before the Initialize operation can be called
26655  again.
26656  This function will NEVER block waiting for hardware. If the operation
26657  requires time to allow the hardware to complete, this will be reported
26658  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
26659  to find out when the module is in the ready state.
26660 */
26661 
26662 void
26664  SYS_MODULE_OBJ object ) ;
26665 //**************************************************************************
26666 /* Function:
26667  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
26668  Summary:
26669  Provides the current status of the SPI driver module.
26670  <p><b>Implementation:</b> Static/Dynamic</p>
26671  Description:
26672  This function provides the current status of the SPI driver module.
26673  Precondition:
26674  The DRV_SPI_Initialize function must have been called before calling
26675  this function.
26676  Parameters:
26677  object - Driver object handle, returned from DRV_SPI_Initialize
26678  Returns:
26679  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
26680  system level operation and cannot start another
26681  Example:
26682  <code>
26683  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26684  SYS_STATUS status;
26685  status = DRV_SPI_Status( object );
26686  if( SYS_STATUS_READY != status )
26687  {
26688  // Handle error
26689  }
26690  </code>
26691  Remarks:
26692  Any value greater than SYS_STATUS_READY is also a normal running state
26693  in which the driver is ready to accept new operations.
26694  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
26695  deinitialized
26696  This value is less than SYS_STATUS_ERROR.
26697  This function can be used to determine when any of the driver's module
26698  level operations has completed.
26699  If the status operation returns SYS_STATUS_BUSY, the previous operation
26700  has not yet completed. Once the status operation returns
26701  SYS_STATUS_READY, any previous operations have completed.
26702  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
26703  that is also an error state.
26704  This function will NEVER block waiting for hardware.
26705  If the Status operation returns an error value, the error may be
26706  cleared by calling the reinitialize operation. If that fails, the
26707  deinitialize operation will need to be called, followed by the
26708  initialize operation to return to normal operations.
26709 */
26710 
26711 SYS_STATUS
26712  DRV_SPI_Status (
26713  SYS_MODULE_OBJ object ) ;
26714 // *****************************************************************************
26715 /* Function:
26716  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
26717  Summary:
26718  Maintains the driver's state machine and implements its ISR.
26719  <p><b>Implementation:</b> Static/Dynamic</p>
26720  Description:
26721  This routine is used to maintain the driver's internal state
26722  machine and implement its transmit ISR for interrupt-driven implementations.
26723  In polling mode, this function should be called from the SYS_Tasks()
26724  function. In interrupt mode, this function should be called in the transmit
26725  interrupt service routine of the USART that is associated with this USART
26726  driver hardware instance.
26727  Precondition:
26728  The DRV_SPI_Initialize routine must have been called for the specified
26729  SPI driver instance.
26730  Parameters:
26731  object - Object handle for the specified driver instance (returned from
26732  DRV_SPI_Initialize)
26733  Returns:
26734  None.
26735  Example:
26736  <code>
26737  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26738  while( true )
26739  {
26740  DRV_SPI_Tasks ( object );
26741  // Do other tasks
26742  }
26743  </code>
26744  Remarks:
26745  This function is normally not called directly by an application. It is
26746  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
26747  ISR.
26748  This function may execute in an ISR context and will never block or access any
26749  resources that may cause it to block.
26750 */
26751 
26752 void
26753  DRV_SPI_Tasks (
26754  SYS_MODULE_OBJ object ) ;
26755 // *****************************************************************************
26756 // *****************************************************************************
26757 // Section: Interface Routines - Client Level
26758 // *****************************************************************************
26759 // *****************************************************************************
26760 //**************************************************************************
26761 /* Function:
26762  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
26763  const DRV_IO_INTENT ioIntent )
26764  Summary:
26765  Opens the specified SPI driver instance and returns a handle to it.
26766  <p><b>Implementation:</b> Static/Dynamic</p>
26767  Description:
26768  This routine opens the specified SPI driver instance and provides a
26769  handle that must be provided to all other client-level operations to
26770  identify the caller and the instance of the driver. The ioIntent
26771  parameter defines how the client interacts with this driver instance.
26772  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
26773  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
26774  able to write to the driver. If the ioIntent in
26775  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
26776  write.
26777  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
26778  exclusive access to this client. The driver cannot be opened by any
26779  other client.
26780  Precondition:
26781  The DRV_SPI_Initialize function must have been called before calling
26782  this function.
26783  Parameters:
26784  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
26785  Please note this is not the SPI ID.
26786  ioIntent - Zero or more of the values from the enumeration
26787  DRV_IO_INTENT ORed together to indicate the intended use of
26788  the driver
26789  Returns:
26790  If successful, the routine returns a valid open-instance handle (a
26791  number identifying both the caller and the module instance).
26792  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
26793  can occur when the following is true:
26794  * if the number of client objects allocated via
26795  DRV_SPI_INSTANCES_NUMBER is insufficient
26796  * if the client is trying to open the driver but driver has been
26797  opened exclusively by another client
26798  * if the driver hardware instance being opened is not initialized or
26799  is invalid
26800  Example:
26801  <code>
26802  DRV_HANDLE handle;
26803  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
26804  if( DRV_HANDLE_INVALID == handle )
26805  {
26806  // Unable to open the driver
26807  }
26808  </code>
26809  Remarks:
26810  The handle returned is valid until the DRV_SPI_Close routine is
26811  called. This routine will NEVER block waiting for hardware. If the
26812  requested intent flags are not supported, the routine will return
26813  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
26814  It should not be called in an ISR.
26815 */
26816 
26817 DRV_HANDLE
26818  DRV_SPI_Open (
26819  const SYS_MODULE_INDEX drvIndex ,
26820  const DRV_IO_INTENT ioIntent ) ;
26821 //**************************************************************************
26822 /* Function:
26823  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
26824  const DRV_SPI_CLIENT_DATA * cfgData )
26825  Summary:
26826  Configures a SPI client with specific data.
26827  <p><b>Implementation:</b> Static/Dynamic</p>
26828  Description:
26829  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
26830  Whenever a new SPI job is started these values will be used. Passing in NULL will
26831  reset the client back to configuration parameters passed to driver initialization.
26832  A zero in any of the structure elements will reset that specific configuration back
26833  to the driver default.
26834  Precondition:
26835  The DRV_SPI_Open function must have been called before calling
26836  this function.
26837  Parameters:
26838  handle - handle of the client returned by DRV_SPI_Open.
26839  cfgData - Client-specific configuration data.
26840  Returns:
26841  - If successful - the routing will return greater than or equal to zero
26842  - If an error occurs - the return value is negative
26843 */
26844 
26845 int32_t
26847  DRV_HANDLE handle ,
26848  const DRV_SPI_CLIENT_DATA * cfgData ) ;
26849 // *****************************************************************************
26850 /* Function:
26851  void DRV_SPI_Close ( DRV_HANDLE handle )
26852  Summary:
26853  Closes an opened instance of the SPI driver.
26854  <p><b>Implementation:</b> Static/Dynamic</p>
26855  Description:
26856  This function closes an opened instance of the SPI driver, invalidating the
26857  handle.
26858  Precondition:
26859  The DRV_SPI_Initialize routine must have been called for the specified
26860  SPI driver instance.
26861  DRV_SPI_Open must have been called to obtain a valid opened device handle.
26862  Parameters:
26863  handle - A valid open-instance handle, returned from the driver's
26864  open routine
26865  Returns:
26866  None.
26867  Example:
26868  <code>
26869  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26870  DRV_SPI_Close ( handle );
26871  </code>
26872  Remarks:
26873  After calling this routine, the handle passed in "handle" must not be used
26874  with any of the remaining driver routines. A new handle must be obtained by
26875  calling DRV_SPI_Open before the caller may use the driver again. This
26876  function is thread safe in a RTOS application.
26877  Note:
26878  Usually there is no need for the driver client to verify that the Close
26879  operation has completed.
26880 */
26881 
26882 void
26883  DRV_SPI_Close (
26884  DRV_HANDLE handle ) ;
26885 // *****************************************************************************
26886 // *****************************************************************************
26887 // Section: Interface Routines - Client level Read & Write APIs
26888 // *****************************************************************************
26889 // *****************************************************************************
26890 /* These are non-blocking APIs. It doesn't wait until the operation gets
26891  finished. The actual operation will happen it the task routine. The status of
26892  this operation can be monitored using DRV_SPI_BufferStatus function. In
26893  polling mode, User must ensure that the code gets time to execute the task
26894  routine. */
26895 //*******************************************************************************
26896 /* Function:
26897  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
26898  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26899  void * context )
26900  Summary:
26901  Registers a buffer for a read operation. Actual transfer will happen in
26902  the Task function.
26903  <p><b>Implementation:</b> Static/Dynamic</p>
26904  Description:
26905  Registers a buffer for a read operation. Actual transfer will happen in
26906  the Task function. The status of this operation can be monitored using
26907  DRV_SPI_BufferStatus function. A optional callback can also be
26908  provided that will be called when the operation is complete.
26909  Precondition:
26910  The DRV_SPI_Initialize routine must have been called for the specified
26911  SPI driver instance.
26912  DRV_SPI_Open must have been called to obtain a valid opened device
26913  handle.
26914  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
26915  in the DRV_SPI_Open call.
26916  Parameters:
26917  handle - A valid open-instance handle, returned from the driver's
26918  open routine
26919  rxBuffer - The buffer to which the data should be written to.
26920  size - Number of bytes to be read from the SPI bus.
26921  completeCB - Pointer to a function to be called when this queued operation is complete.
26922  context - unused by the driver but this is passed to the callback when it is called.
26923  Returns:
26924  If the buffer add request is successful, a valid buffer handle is returned.
26925  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
26926  Example:
26927  <code>
26928  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26929  char myBuffer[MY_BUFFER_SIZE], state = 0;
26930  DRV_SPI_BUFFER_HANDLE bufferHandle;
26931  switch ( state )
26932  {
26933  case 0:
26934  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
26935  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
26936  {
26937  state++;
26938  }
26939  break;
26940  case 1:
26941  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
26942  {
26943  state++;
26944  // All transmitter data has been sent successfully.
26945  }
26946  break;
26947  }
26948  </code>
26949  Remarks:
26950  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
26951  instead of it.
26952  */
26953 
26956  DRV_HANDLE handle ,
26957  void * rxBuffer ,
26958  size_t size ,
26959  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
26960  void * context ) ;
26961 //*******************************************************************************
26962 /* Function:
26963  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
26964  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26965  void * context )
26966  Summary:
26967  Registers a buffer for a write operation. Actual transfer will happen
26968  in the Task function.
26969  <p><b>Implementation:</b> Static/Dynamic</p>
26970  Description:
26971  Registers a buffer for a write operation. Actual transfer will happen
26972  in the Task function. The status of this operation can be monitored
26973  using DRV_SPI_BufferStatus function. A optional callback can also be
26974  provided that will be called when the operation is complete.
26975  Precondition:
26976  The DRV_SPI_Initialize routine must have been called for the specified
26977  SPI driver instance.
26978  DRV_SPI_Open must have been called to obtain a valid opened device
26979  handle.
26980  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
26981  in the DRV_SPI_Open call.
26982  Parameters:
26983  handle - A valid open-instance handle, returned from the driver's
26984  open routine
26985  txBuffer - The buffer which hold the data.
26986  size - Number of bytes to be written to the SPI bus.
26987  completeCB - Pointer to a function to be called when this queued operation is complete
26988  context - unused by the driver but this is passed to the callback when it is called
26989  Returns:
26990  If the buffer add request is successful, a valid buffer handle is returned.
26991  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
26992  Example:
26993  <code>
26994  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26995  char myBuffer[MY_BUFFER_SIZE], state = 0;
26996  DRV_SPI_BUFFER_HANDLE bufferHandle;
26997  switch ( state )
26998  {
26999  case 0:
27000  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27001  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27002  {
27003  state++;
27004  }
27005  break;
27006  case 1:
27007  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27008  {
27009  state++;
27010  // All transmitter data has been sent successfully.
27011  }
27012  break;
27013  }
27014  </code>
27015  Remarks:
27016  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27017  instead of it.
27018 */
27019 
27022  DRV_HANDLE handle ,
27023  void * txBuffer ,
27024  size_t size ,
27025  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27026  void * context ) ;
27027 //*******************************************************************************
27028 /* Function:
27029  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27030  void *txBuffer, void *rxBuffer, size_t size, )
27031  Summary:
27032  Registers a buffer for a read and write operation. Actual transfer will
27033  happen in the Task function.
27034  <p><b>Implementation:</b> Static/Dynamic</p>
27035  Description:
27036  Registers a buffer for a read and write operation. Actual transfer will
27037  happen in the Task function. The status of this operation can be
27038  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27039  provided that will be called when the operation is complete.
27040  Precondition:
27041  The DRV_SPI_Initialize routine must have been called for the specified
27042  SPI driver instance.
27043  DRV_SPI_Open must have been called to obtain a valid opened device
27044  handle.
27045  Parameters:
27046  handle - A valid open-instance handle, returned from the driver's
27047  open routine
27048  txBuffer - The buffer which hold the data.
27049  txSize - Number of bytes to be written to the SPI bus.
27050  rxBuffer - The buffer to which the data should be written to.
27051  rxSize - Number of bytes to be read from the SPI bus
27052  completeCB - Pointer to a function to be called when this queued operation is complete
27053  context - unused by the driver but this is passed to the callback when it is called
27054  Returns:
27055  If the buffer add request is successful, a valid buffer handle is returned.
27056  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27057  Example:
27058  <code>
27059  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27060  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27061  DRV_SPI_BUFFER_HANDLE bufferHandle;
27062  switch ( state )
27063  {
27064  case 0:
27065  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27066  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27067  {
27068  state++;
27069  }
27070  break;
27071  case 1:
27072  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27073  {
27074  state++;
27075  // All transmitter data has been sent successfully.
27076  }
27077  break;
27078  }
27079  </code>
27080  Remarks:
27081  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27082  instead of it.
27083 */
27084 
27087  DRV_HANDLE handle ,
27088  void * txBuffer ,
27089  size_t txSize ,
27090  void * rxBuffer ,
27091  size_t rxSize ,
27092  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27093  void * context ) ;
27094 //*******************************************************************************
27095 /* Function:
27096  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27097  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27098  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27099  Summary:
27100  Registers a buffer for a read operation. Actual transfer will happen in
27101  the Task function.
27102  <p><b>Implementation:</b> Static/Dynamic</p>
27103  Description:
27104  Registers a buffer for a read operation. Actual transfer will happen in
27105  the Task function. The status of this operation can be monitored using
27106  DRV_SPI_BufferStatus function. A optional callback can also be
27107  provided that will be called when the operation is complete.
27108  Precondition:
27109  The DRV_SPI_Initialize routine must have been called for the specified
27110  SPI driver instance.
27111  DRV_SPI_Open must have been called to obtain a valid opened device
27112  handle.
27113  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27114  in the DRV_SPI_Open call.
27115  Parameters:
27116  handle - A valid open-instance handle, returned from the driver's
27117  open routine
27118  rxBuffer - The buffer to which the data should be written to.
27119  size - Number of bytes to be read from the SPI bus.
27120  completeCB - Pointer to a function to be called when this queued operation is complete
27121  context - unused by the driver but this is passed to the callback when it is called
27122  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27123  Returns:
27124  If the buffer add request is successful, a valid buffer handle is returned.
27125  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27126  Example:
27127  <code>
27128  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27129  char myBuffer[MY_BUFFER_SIZE], state = 0;
27130  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27131  switch ( state )
27132  {
27133  case 0:
27134  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27135  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27136  {
27137  state++;
27138  }
27139  break;
27140  case 1:
27141  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27142  {
27143  state++;
27144  // All transmitter data has been sent successfully.
27145  }
27146  break;
27147  }
27148  </code>
27149  Remarks:
27150  None.
27151  */
27152 
27155  DRV_HANDLE handle ,
27156  void * rxBuffer ,
27157  size_t size ,
27158  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27159  void * context ,
27160  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27161 //*******************************************************************************
27162 /* Function:
27163  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27164  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27165  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27166  Summary:
27167  Registers a buffer for a write operation. Actual transfer will happen
27168  in the Task function.
27169  <p><b>Implementation:</b> Static/Dynamic</p>
27170  Description:
27171  Registers a buffer for a write operation. Actual transfer will happen
27172  in the Task function. The status of this operation can be monitored
27173  using DRV_SPI_BufferStatus function. A optional callback can also be
27174  provided that will be called when the operation is complete.
27175  Precondition:
27176  The DRV_SPI_Initialize routine must have been called for the specified
27177  SPI driver instance.
27178  DRV_SPI_Open must have been called to obtain a valid opened device
27179  handle.
27180  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27181  in the DRV_SPI_Open call.
27182  Parameters:
27183  handle - A valid open-instance handle, returned from the driver's
27184  open routine
27185  txBuffer - The buffer which hold the data.
27186  size - Number of bytes to be written to the SPI bus.
27187  completeCB - Pointer to a function to be called when this queued operation is complete
27188  context - unused by the driver but this is passed to the callback when it is called
27189  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27190  Returns:
27191  If the buffer add request is successful, a valid buffer handle is returned.
27192  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27193  Example:
27194  <code>
27195  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27196  char myBuffer[MY_BUFFER_SIZE], state = 0;
27197  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27198  switch ( state )
27199  {
27200  case 0:
27201  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27202  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27203  {
27204  state++;
27205  }
27206  break;
27207  case 1:
27208  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27209  {
27210  state++;
27211  // All transmitter data has been sent successfully.
27212  }
27213  break;
27214  }
27215  </code>
27216  Remarks:
27217  None.
27218 */
27219 
27222  DRV_HANDLE handle ,
27223  void * txBuffer ,
27224  size_t size ,
27225  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27226  void * context ,
27227  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27228 //*******************************************************************************
27229 /* Function:
27230  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27231  void *txBuffer, void *rxBuffer, size_t size,
27232  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27233  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27234  Summary:
27235  Registers a buffer for a read and write operation. Actual transfer will
27236  happen in the Task function.
27237  <p><b>Implementation:</b> Static/Dynamic</p>
27238  Description:
27239  Registers a buffer for a read and write operation. Actual transfer will
27240  happen in the Task function. The status of this operation can be
27241  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27242  provided that will be called when the operation is complete.
27243  Precondition:
27244  The DRV_SPI_Initialize routine must have been called for the specified
27245  SPI driver instance.
27246  DRV_SPI_Open must have been called to obtain a valid opened device
27247  handle.
27248  Parameters:
27249  handle - A valid open-instance handle, returned from the driver's
27250  open routine
27251  txBuffer - The buffer which hold the data.
27252  txSize - Number of bytes to be written to the SPI bus.
27253  rxBuffer - The buffer to which the data should be written to.
27254  rxSize - Number of bytes to be read from the SPI bus
27255  completeCB - Pointer to a function to be called when this queued operation is complete
27256  context - unused by the driver but this is passed to the callback when it is called
27257  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27258  Returns:
27259  If the buffer add request is successful, a valid buffer handle is returned.
27260  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27261  Example:
27262  <code>
27263  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27264  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27265  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27266  switch ( state )
27267  {
27268  case 0:
27269  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27270  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27271  {
27272  state++;
27273  }
27274  break;
27275  case 1:
27276  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27277  {
27278  state++;
27279  // All transmitter data has been sent successfully.
27280  }
27281  break;
27282  }
27283  </code>
27284  Remarks:
27285  None.
27286 */
27287 
27290  DRV_HANDLE handle ,
27291  void * txBuffer ,
27292  size_t txSize ,
27293  void * rxBuffer ,
27294  size_t rxSize ,
27295  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27296  void * context ,
27297  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27298 // *****************************************************************************
27299 /* Function:
27300  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27301  Summary:
27302  Returns the transmitter and receiver transfer status.
27303  <p><b>Implementation:</b> Static/Dynamic</p>
27304  Description:
27305  This returns the transmitter and receiver transfer status.
27306  Precondition:
27307  The DRV_SPI_Initialize routine must have been called for the specified
27308  SPI driver instance.
27309  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27310  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27311  the buffer handle associated with that transfer.
27312  Parameters:
27313  bufferHandle - A valid buffer handle, returned from the driver's
27314  data transfer routine
27315  Returns:
27316  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27317  transfer.
27318  Example:
27319  <code>
27320  // Buffer handle returned from the data transfer function
27321  DRV_SPI_BUFFER_HANDLE bufferHandle;
27322  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27323  {
27324  // All transmitter data has been sent.
27325  }
27326  </code>
27327  Remarks:
27328  The returned status may contain a value with more than one of the bits
27329  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27330  should perform an AND with the bit of interest and verify if the
27331  result is non-zero (as shown in the example) to verify the desired status
27332  bit.
27333 */
27334 
27337  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27338 // *****************************************************************************
27339 /* Function:
27340  bool DRV_SPIn_ReceiverBufferIsFull(void)
27341  Summary:
27342  Returns the receive buffer status. 'n' represents the instance of the
27343  SPI driver used.
27344  <p><b>Implementation:</b> Static</p>
27345  Description:
27346  This function returns the receive buffer status (full/empty).
27347  Precondition:
27348  None.
27349  Parameters:
27350  None.
27351  Returns:
27352  Receive Buffer Status
27353  - 1 - Full
27354  - 0 - Empty
27355  Example:
27356  <code>
27357  bool rxBufStat;
27358  // Using instance 1 of SPI driver, that is n = 1
27359  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27360  if (rxBufStat)
27361  {
27362  ...
27363  }
27364  </code>
27365  Remarks:
27366  None.
27367 */
27368 
27369 bool
27371 // *****************************************************************************
27372 /* Function:
27373  bool DRV_SPIn_TransmitterBufferIsFull(void)
27374  Summary:
27375  Returns the transmit buffer status. 'n' represents the instance of the
27376  SPI driver used.
27377  <p><b>Implementation:</b> Static</p>
27378  Description:
27379  This function returns the transmit buffer status (full/empty).
27380  Precondition:
27381  None.
27382  Parameters:
27383  None.
27384  Returns:
27385  Transmit Buffer Status
27386  - 1 - Full
27387  - 0 - Empty
27388  Example:
27389  <code>
27390  bool txBufStat;
27391  // Using instance 1 of SPI driver, that is n = 1
27392  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27393  if (txBufStat)
27394  {
27395  ...
27396  }
27397  </code>
27398  Remarks:
27399  None.
27400 */
27401 
27402 bool
27404 //DOM-IGNORE-BEGIN
27405 //DOM-IGNORE-END
27406  // #ifndef _DRV_SPI_H
27407 /*******************************************************************************
27408  End of File
27409 */
27410 
27411 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27412 /* CLOSE_FILE Include File */
27413 
27414 /* LDRA REMOVE #include "driver/usb/usbhs/drv_usbhs.h" */
27415 /* LDRA REMOVE #include "usb/usb_device.h" */
27416 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27417 /**************************************************************************************/
27418 /* LDRA_INSPECTED 110 S
27419 */
27435 /**************************************************************************************/
27436 #ifndef APP_H /* Guard against multiple inclusion.*/
27437 #define APP_H
27438 /**************************************************************************************/
27439 /* ************************************************************************************/
27440 /* Section: Included Files */
27441 /**************************************************************************************/
27442 /**************************************************************************************/
27443 #include <stdint.h>
27444 /**************************************************************************************/
27445 /**************************************************************************************/
27446 /* Section: Data Types */
27447 /**************************************************************************************/
27448 /**************************************************************************************/
27449 /**************************************************************************************/
27450 /* APP_DATA
27451  Summary:
27452  Holds APP_DATA used for the APP tasks.
27453  Description:
27454  Holds APP_DATA used for the APP tasks. The variables
27455  used are stored here.
27456  Remarks:
27457  None
27458  */
27459 
27460 typedef
27461  struct
27462  {
27463  uint8_t RevNumber ;
27464  } APP_DATA ;
27465 
27466 extern APP_DATA
27467  APP ;
27468 /**************************************************************************************/
27469 /**************************************************************************************/
27470 /* Section: Application Initialization and State Machine Functions */
27471 /**************************************************************************************/
27472 /**************************************************************************************/
27473 /*!*************************************************************************************
27474  Function:
27475  void APP_Initialize(void)
27476  Summary:
27477  Autonomous tool application initialization routine.
27478  Description:
27479  This function initializes the application. It places the
27480  application in its initial state and prepares it to run so that its
27481  APP_Tasks function can be called.
27482  Precondition:
27483  All other system initialization routines should be called before calling
27484  this routine (in "SYS_Initialize").
27485  Parameters:
27486  None.
27487  Returns:
27488  None.
27489  Example:
27490  APP_Initialize()
27491  Remarks:
27492  This routine must be called from the main function.
27493 */
27494 
27495 void
27496  APP_Initialize ( void ) ;
27497 /*!*************************************************************************************
27498  Function:
27499  void APP_Tasks(void)
27500  Summary:
27501  Application tasks function
27502  Description:
27503  This function is the main application's tasks function. It contains the various
27504  tasks that are maintained during the operation of the shooting panel.
27505  Precondition:
27506  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27507  should be called before calling this.
27508  Parameters:
27509  None.
27510  Returns:
27511  None.
27512  Example:
27513  APP_Tasks()
27514  Remarks:
27515  This routine must be called from the main() routine.
27516  */
27517 
27518 void
27519  APP_Tasks ( void ) ;
27520  /* APP_H */
27521 /***************************************************************************************
27522  End of File
27523  */
27524 
27525 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
27526 /* CLOSE_FILE Include File */
27527 
27528 // DOM-IGNORE-BEGIN
27529 // DOM-IGNORE-END
27530 // *****************************************************************************
27531 // *****************************************************************************
27532 // Section: Type Definitions
27533 // *****************************************************************************
27534 // *****************************************************************************
27535 // *****************************************************************************
27536 /* System Objects
27537  Summary:
27538  Structure holding the system's object handles
27539  Description:
27540  This structure contains the object handles for all objects in the
27541  MPLAB Harmony project's system configuration.
27542  Remarks:
27543  These handles are returned from the "Initialize" functions for each module
27544  and must be passed into the "Tasks" function for each module.
27545 */
27546 
27547 typedef
27548  struct
27549  {
27550  SYS_MODULE_OBJ sysTmr ;
27551  SYS_MODULE_OBJ drvTmr0 ;
27552  SYS_MODULE_OBJ drvTmr1 ;
27553  SYS_MODULE_OBJ drvTmr2 ;
27554  SYS_MODULE_OBJ drvTmr3 ;
27555  SYS_MODULE_OBJ drvTmr4 ;
27556  SYS_MODULE_OBJ drvUsart0 ;
27557  SYS_MODULE_OBJ drvPMP0 ;
27558  /*** SPI Object for Index 0 ***/
27559  SYS_MODULE_OBJ spiObjectIdx0 ;
27560  /*** SPI Object for Index 1 ***/
27561  SYS_MODULE_OBJ spiObjectIdx1 ;
27562  /*** SPI Object for Index 2 ***/
27563  SYS_MODULE_OBJ spiObjectIdx2 ;
27564  SYS_MODULE_OBJ drvUSBObject ;
27565  SYS_MODULE_OBJ usbDevObject0 ;
27566  } SYSTEM_OBJECTS ;
27567 // *****************************************************************************
27568 // *****************************************************************************
27569 // Section: extern declarations
27570 // *****************************************************************************
27571 // *****************************************************************************
27572 
27573 extern SYSTEM_OBJECTS
27574  sysObj ;
27575 //DOM-IGNORE-BEGIN
27576 //DOM-IGNORE-END
27577  /* _SYS_DEFINITIONS_H */
27578 /*******************************************************************************
27579  End of File
27580 */
27581 
27582 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
27583 /* CLOSE_FILE Include File */
27584 
27585 #include "app.h"
27586 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\switches.h */
27587 /**************************************************************************************/
27603 /**************************************************************************************/
27604 #ifndef SWITCHES_H /* Guard against multiple inclusion.*/
27605 #define SWITCHES_H
27606 /**************************************************************************************/
27607 /**************************************************************************************/
27608 /* Section: Included Files */
27609 /**************************************************************************************/
27610 /**************************************************************************************/
27611 #include <stdint.h>
27612 #include <stdbool.h>
27613 /**************************************************************************************/
27614 /**************************************************************************************/
27615 /* Section: Defines */
27616 /**************************************************************************************/
27617 /**************************************************************************************/
27618 #define S3_NUM_OF_POSITIONS 5U
27619 #define S6_NUM_OF_POSITIONS 3U
27620 #define S4_NUM_OF_POSITIONS 2U
27621 #define S1_NUM_OF_POSITIONS 2U
27622 /**************************************************************************************/
27623 /**************************************************************************************/
27624 /* Section: Data Types */
27625 /**************************************************************************************/
27626 /**************************************************************************************/
27627 /**************************************************************************************/
27628 /* SWITCH states
27629  Summary:
27630  SWITCH states enumeration
27631  Description:
27632  This enumeration defines the valid SWITCH states. These states
27633  determine the behavior of the SWITCH state machine at various times.
27634 */
27635 
27636 typedef
27637  enum
27638  {
27645  } SWITCH_STATES ;
27646 /**************************************************************************************/
27647 /* SWITCH_DATA
27648  Summary:
27649  Holds SWITCH_DATA used for the SWITCH tasks.
27650  Description:
27651  Holds SWITCH_DATA used for the SWITCH tasks. The state machine and variables
27652  used to control SWITCH functions are stored here.
27653  Remarks:
27654  None
27655  */
27656 
27657 typedef
27658  struct
27659  {
27661  uint8_t knob_switch_S3 [ 5 ] ;
27662  uint8_t key_switch_S6 [ 3 ] ;
27663  uint8_t pol_switch_S4 [ 2 ] ;
27665  uint8_t fire_switch_S1 [ 2 ] ;
27666  uint8_t hvps_switch_S5 ;
27667  bool S3_flag ;
27668  bool S6_flag ;
27669  bool S4_flag ;
27670  bool S1_flag ;
27671  uint16_t store_buffer [ 2 ] ;
27672  uint16_t settings ;
27676  uint8_t read_try ;
27677  } SWITCH_DATA ;
27678 
27679 extern SWITCH_DATA
27680  SWITCH ;
27681 /**************************************************************************************/
27682 /* S3_COMMAND
27683  Summary:
27684  S3_COMMAND enumeration
27685  Description:
27686  This enumeration defines the valid S3_COMMAND results. These states
27687  determine the behavior of the SWITCH state machine at various times.
27688 */
27689 
27690 typedef
27691  enum
27692  {
27698  } S3_COMMAND ;
27699 /**************************************************************************************/
27700 /* S4_COMMAND
27701  Summary:
27702  S4_COMMAND enumeration
27703  Description:
27704  This enumeration defines the valid S4_COMMAND results. These states
27705  determine the behavior of the SWITCH state machine at various times.
27706 */
27707 
27708 typedef
27709  enum
27710  {
27713  } S4_COMMAND ;
27714 /**************************************************************************************/
27715 /* S7_COMMAND
27716  Summary:
27717  S7_COMMAND enumeration
27718  Description:
27719  This enumeration defines the valid S7_COMMAND results. These states
27720  determine the behavior of the S7_SWITCH state machine at various times.
27721 */
27722 
27723 typedef
27724  enum
27725  {
27729  } S7_COMMAND ;
27730 /**************************************************************************************/
27731 /* S1_COMMAND
27732  Summary:
27733  S1_COMMAND enumeration
27734  Description:
27735  This enumeration defines the valid S1_COMMAND results. These states
27736  determine the behavior of the SWITCH state machine at various times.
27737 */
27738 
27739 typedef
27740  enum
27741  {
27744  } S1_COMMAND ;
27745 /**************************************************************************************/
27746 /* S5_COMMAND
27747  Summary:
27748  S5_COMMAND enumeration
27749  Description:
27750  This enumeration defines the valid S5_COMMAND results. These states
27751  determine the behavior of the S5_SWITCH state machine at various times.
27752 */
27753 
27754 typedef
27755  enum
27756  {
27759  } S5_COMMAND ;
27760 /**************************************************************************************/
27761 /* SWITCH_COMMAND
27762  Summary:
27763  Holds SWITCH_COMMAND data used for the SWITCH tasks.
27764  Description:
27765  Holds SWITCH_COMMAND data used for the SWITCH tasks. The state machine and variables
27766  used to control SWITCH_COMMAND functions are stored here.
27767  Remarks:
27768  None
27769  */
27770 
27771 typedef
27772  struct
27773  {
27781  } SWITCH_COMMAND ;
27782 
27783 extern SWITCH_COMMAND
27784  SW_COM ;
27785 /**************************************************************************************/
27786 /**************************************************************************************/
27787 /* Section: Local Functions */
27788 /**************************************************************************************/
27789 /**************************************************************************************/
27790 /*!*************************************************************************************
27791  Function:
27792  static void read_switches(void)
27793  Summary:
27794  This function determines all of the switch positions.
27795  Description:
27796  This function determines all of the switch positions. It does this by
27797  monitoring all of a given switches lines and ensuring that only one line per
27798  switch is active. For switches with multiple positions, each position is put
27799  into an array. Only one location in a given array can be active or true.
27800  The switch locations are then passed on to be processed and
27801  converted into commands to actuate relays or other activity.
27802 
27803  Precondition:
27804  None.
27805  Parameters:
27806  None.
27807  Returns
27808  None.
27809 
27810  Remarks:
27811  None.
27812 
27813  Example:
27814  read_switches()
27815  */
27816 
27817 static void
27818  read_switches ( void ) ;
27819 /*!*************************************************************************************
27820  Function:
27821  static void process_switches(void)
27822  Summary:
27823  This function converts the front panel switch positions into commands.
27824  Description:
27825  This function converts the front panel switch positions into commands. It does
27826  this by converting a switch active array location into a command that can be
27827  executed. The commands from a switch are held as state machines.
27828 
27829  Precondition:
27830  None.
27831  Parameters:
27832  None.
27833  Returns
27834  None.
27835 
27836  Remarks:
27837  None.
27838 
27839  Example:
27840  process_switches()
27841  */
27842 
27843 static void
27844  process_switches ( void ) ;
27845 /*!*************************************************************************************
27846  Function:
27847  static void execute_switches(void)
27848  Summary:
27849  This function actuates relays based on the front panel switch position.
27850  Description:
27851  This function actuates relays based on the front panel switch position.
27852 
27853  Precondition:
27854  None.
27855  Parameters:
27856  None.
27857  Returns
27858  None.
27859 
27860  Remarks:
27861  None.
27862 
27863  Example:
27864  static void execute_switches()
27865  */
27866 
27867 static void
27868  execute_switches ( void ) ;
27869 /*!*************************************************************************************
27870  Function:
27871  static void store_switches(void)
27872  Summary:
27873  This function stores the switch positions to be transferred to the host.
27874  Description:
27875  This function stores the switch positions to be transferred to the host. The
27876  switch positions are transferred into two 8-bit array locations. This data can
27877  then be sent to the host when requested. No other actions occur with this data.
27878 
27879  Precondition:
27880  None.
27881  Parameters:
27882  None.
27883  Returns
27884  None.
27885 
27886  Remarks:
27887  None.
27888 
27889  Example:
27890  store_switches()
27891  */
27892 
27893 static void
27894  store_switches ( void ) ;
27895 /**************************************************************************************/
27896 /**************************************************************************************/
27897 /* State Machine Functions */
27898 /**************************************************************************************/
27899 /**************************************************************************************/
27900 /*!*************************************************************************************
27901  Function:
27902  void SWITCH_Tasks ( void )
27903  Summary:
27904  SWITCH_Tasks function
27905  Description:
27906  This routine is the SWITCH_Tasks function. It defines the SWITCH_Tasks state
27907  machine and core logic. This machine is used to monitor the front panel switches
27908  and perform the tasks as designated by the switches.
27909  Precondition:
27910  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27911  should be called before calling this.
27912  Parameters:
27913  None.
27914  Returns:
27915  None.
27916  Remarks:
27917  This routine must be called from the APP_Tasks() routine.
27918  Example:
27919  SWITCH_Task()
27920  */
27921 
27922 void
27923  SWITCH_Tasks ( void ) ;
27924  /* SWITCHES_H */
27925 /***************************************************************************************
27926  End of File
27927  */
27928 
27929 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\switches.h*/
27930 /* CLOSE_FILE Include File */
27931 
27932 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h */
27933 /**************************************************************************************/
27947 /**************************************************************************************/
27948 #ifndef ADC_H /* Guard against multiple inclusion.*/
27949 #define ADC_H
27950 /**************************************************************************************/
27951 /**************************************************************************************/
27952 /* Section: Included Files */
27953 /**************************************************************************************/
27954 /**************************************************************************************/
27955 #include <stdint.h>
27956 #include <stdbool.h>
27957 /**************************************************************************************/
27958 /**************************************************************************************/
27959 /* Section: Data Types */
27960 /**************************************************************************************/
27961 /**************************************************************************************/
27962 /**************************************************************************************/
27963 /* ADC states
27964  Summary:
27965  ADC states enumeration
27966  Description:
27967  This enumeration defines the valid ADC states. These states
27968  determine the behavior of the ADC state machine at various times.
27969 */
27970 
27971 typedef
27972  enum
27973  {
27978  } ADC_STATES ;
27979 /**************************************************************************************/
27980 /* ADC_DATA
27981  Summary:
27982  Holds ADC_DATA used for the ADC tasks.
27983  Description:
27984  Holds ADC_DATA used for the ADC tasks. The state machine and variables
27985  used to control ADC functions are stored here.
27986  Remarks:
27987  None
27988  */
27989 
27990 typedef
27991  struct /* This structure collects the variables and states required for these*/
27992  {
27993  /* functions to operate.*/
27994  ADC_STATES state ;
27995  uint16_t hvps_i ;
27996  uint16_t hvps_cont ;
27997  uint16_t wl_cps_i ;
27998  uint16_t wl_cps_v ;
27999  uint16_t wl_sps_i_cf ;
28000  uint16_t wl_sps_i ;
28001  bool tick ;
28002  bool ADCInt ;
28003  } ADC_DATA ;
28004 
28005 extern ADC_DATA
28006  ADC ;
28007 /**************************************************************************************/
28008 /**************************************************************************************/
28009 /* State Machine Functions */
28010 /**************************************************************************************/
28011 /**************************************************************************************/
28012 /*!*************************************************************************************
28013  Function:
28014  void ADC_Tasks(void)
28015  Summary:
28016  ADC tasks function
28017  Description:
28018  This routine is the ADC tasks function. It defines the ADC's state machine and
28019  core logic. This machine initializes the Timer and ADCs used to digitize signal
28020  inputs. Once the timer and ADCs are started, this machine is set to idle and the
28021  the updated ADC values are retrieved in the system interrupt routine.
28022  Precondition:
28023  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28024  should be called before calling this.
28025  Parameters:
28026  None.
28027  Returns:
28028  None.
28029  Example:
28030  ADC_Tasks()
28031 
28032  Remarks:
28033  This routine must be called from the APP_Tasks() routine.
28034  */
28035 
28036 void
28037  ADC_Tasks ( void ) ;
28038  /* ADC_H */
28039 /***************************************************************************************
28040  End of File
28041  */
28042 
28043 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h*/
28044 /* CLOSE_FILE Include File */
28045 
28046 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commmodule.h */
28047 /**************************************************************************************/
28063 /**************************************************************************************/
28064 #ifndef COMMMODULE_H /* Guard against multiple inclusion.*/
28065 #define COMMMODULE_H
28066 /**************************************************************************************/
28067 /**************************************************************************************/
28068 /* Section: Included Files */
28069 /**************************************************************************************/
28070 /**************************************************************************************/
28071 #include "../system_definitions.h"
28072 /**************************************************************************************/
28073 /**************************************************************************************/
28074 /* Section: Data Types */
28075 /**************************************************************************************/
28076 /**************************************************************************************/
28077 /**************************************************************************************/
28078 /* COMM states
28079  Summary:
28080  COMM states enumeration
28081  Description:
28082  This enumeration defines the valid COMM states. These states
28083  determine the behavior of the COMM state machine at various times.
28084 */
28085 
28086 typedef
28087  enum
28088  {
28093  } COMM_STATES ;
28094 /**************************************************************************************/
28095 /* COMM Data
28096  Summary:
28097  Holds COMM data used for the COMM tasks.
28098  Description:
28099  Holds COMM data used for the COMM tasks. The state machine and variables used
28100  to control COMM message are stored here.
28101  Remarks:
28102  None
28103  */
28104 
28105 typedef
28106  struct /* This structure collects the variables and states required for these*/
28107  {
28108  /* functions to operate.*/
28109  COMM_STATES state ;
28110  DRV_HANDLE handleUSART0 ;
28111  uint8_t tx_count ;
28112  uint8_t rx_count ;
28113  bool processing ;
28114  } COMM_DATA ;
28115 
28116 extern COMM_DATA
28117  COMM ;
28118 /**************************************************************************************/
28119 /**************************************************************************************/
28120 /* Section: Local Functions */
28121 /**************************************************************************************/
28122 /**************************************************************************************/
28123 /*!*************************************************************************************
28124  Function:
28125  static void ValidateComm(void)
28126  Summary:
28127  This function reads the battery voltage, temperature and remaining capacity
28128  based on the command given to the function
28129  Description:
28130  Description: This task handles reading messages from Receive Queue (RxQ Fifo) and
28131  processes them. It looks for a valid command & upon finding it puts the remainder
28132  into the Command buffer for processing.
28133 
28134 
28135 
28136  Precondition:
28137  None.
28138  Parameters:
28139  None.
28140  Returns
28141  None.
28142 
28143  Remarks
28144  None.
28145 
28146  Example:
28147  void ValidateComm()
28148  */
28149 
28150 static void
28151  ValidateComm ( void ) ;
28152 /**************************************************************************************/
28153 /**************************************************************************************/
28154 /* State Machine Functions */
28155 /**************************************************************************************/
28156 /**************************************************************************************/
28157 /*!*************************************************************************************
28158  Function:
28159  void COMM_Tasks(void)
28160  Summary:
28161  COMM tasks function
28162  Description:
28163  This routine is the COMM tasks function. It defines the COMM's state machine and
28164  core logic. This task controls the communications between a host UART or host USB.
28165  Precondition:
28166  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28167  should be called before calling this.
28168  Parameters:
28169  None.
28170  Returns:
28171  None.
28172  Example:
28173  COMM_Tasks()
28174 
28175  Remarks:
28176  This routine must be called from COMM_Tasks() routine.
28177  */
28178 
28179 void
28180  COMM_Tasks ( void ) ;
28181  /* COMMMODULE_H */
28182 /***************************************************************************************
28183  End of File
28184  */
28185 
28186 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commmodule.h*/
28187 /* CLOSE_FILE Include File */
28188 
28189 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps.h */
28190 //**************************************************************************************/
28204 /**************************************************************************************/
28205 #ifndef HVPS_H /* Guard against multiple inclusion.*/
28206 #define HVPS_H
28207 /**************************************************************************************/
28208 /**************************************************************************************/
28209 /* Section: Included Files */
28210 /**************************************************************************************/
28211 /**************************************************************************************/
28212 #include "../system_definitions.h"
28213 /**************************************************************************************/
28214 /**************************************************************************************/
28215 /* Section: Data Types */
28216 /**************************************************************************************/
28217 /**************************************************************************************/
28218 /**************************************************************************************/
28219 /* HVPS_STATES
28220  Summary:
28221  HVPS_STATES enumeration
28222  Description:
28223  This enumeration defines the valid HVPS states. These states
28224  determine the behavior of the HVPS state machine at various times.
28225 */
28226 
28227 typedef
28228  enum
28229  {
28242  } HVPS_STATES ;
28243 /**************************************************************************************/
28244 /* HVPS_DATA
28245  Summary:
28246  Holds HVPS_DATA used for the HVPS tasks.
28247  Description:
28248  Holds HVPS_DATA used for the HVPS tasks. The state machine and variables
28249  used to control HVPS functions are stored here.
28250  Remarks:
28251  None
28252  */
28253 
28254 typedef
28255  struct /* This structure collects the variables and states required for these*/
28256  {
28257  /* functions to operate.*/
28258  HVPS_STATES state ;
28259  DRV_HANDLE drvSPIHandle ;
28260  DRV_SPI_BUFFER_HANDLE bufferHandle ;
28261  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
28262  bool spi_write_complete_flag ;
28263  bool spi_sent_flag ;
28264  uint16_t adj [ 1 ] ;
28265  uint16_t cont_in ;
28266  bool pot_switch ;
28267  bool new_cont_values_flag ;
28268  bool tick ;
28269  uint16_t cont_prev ;
28270  uint16_t cont_new ;
28271  uint16_t count ;
28272  bool pos_dir ;
28273  bool shutdown ;
28274  uint16_t update_rate ;
28275  uint16_t rate_time ;
28276  uint16_t update_count ;
28277  bool update_flag ;
28278  uint16_t voltage ;
28279  uint16_t current ;
28280  uint16_t sensor_offset ;
28281  uint16_t offset ;
28282  uint16_t sensor_constant ;
28283  uint16_t max_current ;
28284  uint16_t current_limit ;
28285  uint16_t upper_current_limit ;
28286  uint8_t over_current_count ;
28287  bool new_current_values_flag ;
28288  bool new_voltage_values_flag ;
28289  bool overcurrent_flag ;
28290  bool overvoltage_flag ;
28291  } HVPS_DATA ;
28292 
28293 extern HVPS_DATA
28294  HV_PS ;
28295 /**************************************************************************************/
28296 /**************************************************************************************/
28297 /* Section: Interface Functions */
28298 /**************************************************************************************/
28299 /**************************************************************************************/
28300 /*!*************************************************************************************
28301  Function:
28302  void Set_HVPS_Ramp_Rate( uint16_t value )
28303  Summary:
28304  This function sets update rate for the HVPS control voltage.
28305  Description:
28306  This function sets update rate for the HVPS control voltage. Value is a rate in
28307  volts/second. This value is then converted to an update rate for the control DAC.
28308  For example, an update value of 100V/second gives an DAC update rate of approx.
28309  20mS. This update rate is used with Timer 1 to control when the control DAC is
28310  updated.
28311 
28312  Precondition:
28313  None.
28314  Parameters:
28315  uint16_t value: Value representing volts/second.
28316  Returns
28317  None.
28318 
28319  Remarks:
28320  None.
28321 
28322  Example:
28323  SET_WL_SPS_IOffset( unsigned char mode )
28324  */
28325 
28326 void
28328  uint16_t value ) ;
28329 /**************************************************************************************/
28330 /**************************************************************************************/
28331 /* State Machine Functions */
28332 /**************************************************************************************/
28333 /**************************************************************************************/
28334 /*!*************************************************************************************
28335  Function:
28336  void HVPS_Tasks(void)
28337  Summary:
28338  HVPS tasks function
28339  Description:
28340  This routine is the HVPS tasks function. It defines the HVPS's state machine and
28341  core logic.
28342  Precondition:
28343  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28344  should be called before calling this.
28345  Parameters:
28346  None.
28347  Returns:
28348  None.
28349  Example:
28350  HVPS_Tasks()
28351 
28352  Remarks:
28353  This routine must be called from APP_Tasks() routine.
28354  */
28355 
28356 void
28357  HVPS_Tasks ( void ) ;
28358  /* HVPS_H */
28359 /***************************************************************************************
28360  End of File
28361  */
28362 
28363 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps.h*/
28364 /* CLOSE_FILE Include File */
28365 
28366 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h */
28367 /**************************************************************************************/
28383 /**************************************************************************************/
28384 #ifndef WL_SPS_H /* Guard against multiple inclusion */
28385 #define WL_SPS_H
28386 /**************************************************************************************/
28387 /**************************************************************************************/
28388 /* Section: Included Files */
28389 /**************************************************************************************/
28390 /**************************************************************************************/
28391 #include "../system_config.h"
28392 #include "../system_definitions.h"
28393 #include <stdbool.h>
28394 /**************************************************************************************/
28395 /**************************************************************************************/
28396 /* Section: Defines */
28397 /**************************************************************************************/
28398 /**************************************************************************************/
28399  /* A brief description of a section can be given directly below the section
28400  banner.
28401  */
28402 #define NEGATIVE_OFFSET 0x02U
28403 #define POS_HIGH_OFFSET 0x01U
28404 #define POS_LOW_OFFSET 0x03U
28405 #define DEFAULT_OFFSET 0x04U
28406 #define I_ARRAY_SIZE 50U
28407 
28408 typedef
28409 float
28411 /**************************************************************************************/
28412 /**************************************************************************************/
28413 /* Section: Data Types */
28414 /**************************************************************************************/
28415 /**************************************************************************************/
28416 /**************************************************************************************/
28417 /* WL_SPS_STATES
28418  Summary:
28419  WL_SPS_STATES enumeration
28420  Description:
28421  This enumeration defines the valid WL_SPS states. These states
28422  determine the behavior of the WL_SPS state machine at various times.
28423 */
28424 
28425 typedef
28426  enum
28427  {
28435  } WL_SPS_STATES ;
28436 /**************************************************************************************/
28437 /* WL_SPS_DATA
28438  Summary:
28439  Holds WL_SPS_DATA used for the WL_SPS tasks.
28440  Description:
28441  Holds WL_SPS_DATA used for the WL_SPS tasks. The state machine and variables
28442  used to control WL_SPS functions are stored here.
28443  Remarks:
28444  None
28445  */
28446 
28447 typedef
28448  struct
28449  {
28452  uint16_t voltage ;
28453  uint16_t voltage_limit ;
28455  uint16_t volt_count ;
28456  uint16_t current ;
28457  uint16_t max_current ;
28458  uint16_t current_limit ;
28462  uint8_t array_count ;
28463  uint16_t offset ;
28464  int16_t i_array [ 50U ] ;
28465  int16_t i_sum ;
28470  uint16_t sensor_offset ;
28471  uint16_t sensor_constant ;
28473  uint16_t v_array [ 50 ] ;
28474  uint16_t v_array_count ;
28475  uint32_t v_sum ;
28477  bool tick ;
28478  uint8_t no_count ;
28479  bool array_full ;
28481  } WL_SPS_DATA ;
28482 
28483 extern WL_SPS_DATA
28484  WL_SPS ;
28485 /**************************************************************************************/
28486 /**************************************************************************************/
28487 /* Section: Interface Functions */
28488 /**************************************************************************************/
28489 /**************************************************************************************/
28490 /*!*************************************************************************************
28491  Function:
28492  void SET_WL_SPS_IOffset( uint8_t mode )
28493  Summary:
28494  This function sets the wire-line current offset based on external settings.
28495  Description:
28496  This function sets the wire-line current offset based on external settings.
28497 
28498  Precondition:
28499  None.
28500  Parameters:
28501  None.
28502  Returns
28503  None.
28504 
28505  Remarks:
28506  None.
28507 
28508  Example:
28509  SET_WL_SPS_IOffset( uint8_t mode )
28510  */
28511 
28512 void
28514  uint8_t mode ) ;
28515 /*!*************************************************************************************
28516  Function:
28517  void Set_WL_SPS_CurrentLimit(uint16_t value)
28518  Summary:
28519  This function sets the current limit for the wire-line shooting power
28520  supply (WL_SPS).
28521  Description:
28522  This function sets the current limit for the wire-line shooting power
28523  supply (WL_SPS) and ensures it it not greater than the upper current limit.
28524  If the value programmed is greater than the upper current limit, then the the
28525  current limit is set to the upper current limit value.
28526  This is used in the WL_SPS over current check.
28527 
28528  Precondition:
28529  None.
28530  Parameters:
28531  None.
28532  Returns
28533  None.
28534 
28535  Remarks:
28536  None.
28537 
28538  Example:
28539  Set_WL_SPS_CurrentLimit(uint16_t value)
28540  */
28541 
28542 void
28544  uint16_t value ) ;
28545 /**************************************************************************************/
28546 /**************************************************************************************/
28547 /* State Machine Functions */
28548 /**************************************************************************************/
28549 /**************************************************************************************/
28550 /*!*************************************************************************************
28551  Function:
28552  *
28553  void WL_SPS_Tasks(void)
28554  Summary:
28555  WL_SPS_Tasks function
28556  Description:
28557  This routine is the WL_SPS_Tasks function. It defines the WL_SPS_Tasks state
28558  machine and core logic. This machine is used to monitor the wire-line shooting
28559  power supply (WL_SPS) voltage and current and will set flags when those limits
28560  are exceeded. Those flags are monitored by the HV_PS machine and will turn the
28561  supply off if either of those flags are set.
28562  Precondition:
28563  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28564  should be called before calling this.
28565  Parameters:
28566  None.
28567  Returns:
28568  None.
28569  Remarks:
28570  This routine must be called from the APP_Tasks() routine.
28571  Example:
28572  WL_SPS_Tasks()
28573  */
28574 
28575 void
28576  WL_SPS_Tasks ( void ) ;
28577  /* WL_SPS_H */
28578 /***************************************************************************************
28579  End of File
28580  */
28581 
28582 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h*/
28583 /* CLOSE_FILE Include File */
28584 
28585 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_cps.h */
28586 /**************************************************************************************/
28601 /**************************************************************************************/
28602 #ifndef WL_CPS_H /* Guard against multiple inclusion */
28603 #define WL_CPS_H
28604 /**************************************************************************************/
28605 /* ************************************************************************************/
28606 /* Section: Included Files */
28607 /**************************************************************************************/
28608 /**************************************************************************************/
28609 #include "../system_definitions.h"
28610 
28611 typedef
28612 float
28613  float32_t ;
28614 /**************************************************************************************/
28615 /**************************************************************************************/
28616 /* Section: Data Types */
28617 /**************************************************************************************/
28618 /**************************************************************************************/
28619 
28620 typedef
28621  enum
28622  {
28629  } WL_CPS_STATES ;
28630 
28631 typedef
28632  struct
28633  {
28638  int8_t v_adj [ 1 ] ;
28639  uint16_t voltage ;
28640  uint16_t voltage_limit ;
28641  uint16_t current ;
28642  uint16_t max_current ;
28643  uint8_t current_limit ;
28652  uint8_t avg_count ;
28653  uint8_t avg_count_max ;
28654  uint16_t current_array [ 5 ] ;
28655  uint16_t avg_current ;
28657  } WL_CPS_DATA ;
28658 
28659 extern WL_CPS_DATA
28660  WL_CPS ;
28661 /**************************************************************************************/
28662 /**************************************************************************************/
28663 /* Section: Local Functions */
28664 /**************************************************************************************/
28665 /**************************************************************************************/
28666 /*!*************************************************************************************
28667  Function:
28668  static void Init_WL_CPS( void )
28669  Summary:
28670  This function initializes the wire-line communication power supply parameters.
28671  Description:
28672  This function initializes the wire-line communication power supply parameters.
28673  Initial limits, flags and constants are set here.
28674 
28675  Precondition:
28676  None.
28677  Parameters:
28678  None.
28679  Returns
28680  None.
28681 
28682  Remarks
28683  None.
28684 
28685  Example:
28686  Init_WL_CPS()
28687  */
28688 
28689 static void
28690  Init_WL_CPS ( void ) ;
28691 /*!*************************************************************************************
28692  Function:
28693  static void Read_WL_CPS_V_I( void )
28694  Summary:
28695  This task reads the voltage and current from the wire line communication power
28696  supply(WL_CPS). It also tracks the maximum current from the supply.
28697  Description:
28698  This task reads the voltage and current from the wire line communication power
28699  supply(WL_CPS). It also tracks the maximum current from the supply.
28700 
28701  Precondition:
28702  None.
28703  Parameters:
28704  None.
28705  Returns
28706  None.
28707 
28708  Remarks
28709  None.
28710 
28711  Example:
28712  Read_WL_CPS_V_I( )
28713  */
28714 
28715 static void
28716  Read_WL_CPS_V_I ( void ) ;
28717 /*!*************************************************************************************
28718  Function:
28719  static void Check_WL_CPS_Over_Current( void )
28720  Summary:
28721  This function checks if the WL_CPS current has exceeded the current limit.
28722  Description:
28723  This function checks if the WL_CPS current has exceeded the current limit. If
28724  the current has exceeded the limit for five readings, the supply is turned off.
28725 
28726  Precondition:
28727  None.
28728  Parameters:
28729  None.
28730  Returns
28731  None.
28732 
28733  Remarks
28734  None.
28735 
28736  Example:
28737  Check_WL_CPS_Over_Current( )
28738  */
28739 
28740 static void
28741  Check_WL_CPS_Over_Current ( void ) ;
28742 /*!*************************************************************************************
28743  Function:
28744  void Set_WL_CPS_CurrentLimit(uint8_t value)
28745  Summary:
28746  This function sets the WL_CPS current limit.
28747  Description:
28748  This function sets the WL_CPS current limit. It must be less than or equal to
28749  the upper current limit. This parameter is used in the over current check.
28750 
28751  Precondition:
28752  None.
28753  Parameters:
28754  uint8_t value - the current limit in mA.
28755  Returns
28756  None.
28757 
28758  Remarks
28759  None.
28760 
28761  Example:
28762  Set_WL_CPS_CurrentLimit(70)
28763  */
28764 
28765 void
28767  uint8_t value ) ;
28768 /*!*************************************************************************************
28769  Function:
28770  void Adjust_WL_CPS_Voltage(uint8_t target)
28771  Summary:
28772  This function adjusts the WL_CPS to the desired voltage.
28773  Description:
28774  This function adjusts the WL_CPS to the desired voltage. The value is checked
28775  to ensure it is within the adjustable limits of 15 to 64 VDC. That voltage is
28776  converted to a table value that contains the appropriate pot settings for a
28777  given voltage. The pot settings is then transmitted via SPI port to the
28778  WL_CPS control pot.
28779 
28780  Precondition:
28781  None.
28782  Parameters:
28783  uint8_t target - desired voltage between 15 and 64V.
28784  Returns
28785  None.
28786 
28787  Remarks
28788  None.
28789 
28790  Example:
28791  Adjust_WL_CPS_Voltage(30)
28792  */
28793 
28794 void
28796  uint8_t target ) ;
28797 /**************************************************************************************/
28798 /**************************************************************************************/
28799 /* State Machine Functions */
28800 /**************************************************************************************/
28801 /**************************************************************************************/
28802 /*!*************************************************************************************
28803  Function:
28804  *
28805  void WL_CPS_Tasks(void)
28806  Summary:
28807  WL_CPS_Tasks function
28808  Description:
28809  This routine is the WL_SPS_Tasks function. It defines the WL_SPS_Tasks state
28810  machine and core logic. This machine is used to monitor the wire-line communication
28811  power supply (WL_CPS) voltage and current and will set flags when those limits
28812  are exceeded.
28813  Precondition:
28814  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28815  should be called before calling this.
28816  Parameters:
28817  None.
28818  Returns:
28819  None.
28820  Remarks:
28821  This routine must be called from the APP_Tasks() routine.
28822  Example:
28823  WL_CPS_Tasks()
28824  */
28825 
28826 void
28827  WL_CPS_Tasks ( void ) ;
28828  /* WL_CPS_H */
28829 /***************************************************************************************
28830  End of File
28831  */
28832 
28833 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_cps.h*/
28834 /* CLOSE_FILE Include File */
28835 
28836 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fsk.h */
28837 /**************************************************************************************/
28851 /**************************************************************************************/
28852 #ifndef FSK_H /* Guard against multiple inclusion */
28853 #define FSK_H
28854 /**************************************************************************************/
28855 /**************************************************************************************/
28856 /* Section: Included Files */
28857 /**************************************************************************************/
28858 /**************************************************************************************/
28859 #include "../system_config.h"
28860 #include "../system_definitions.h"
28861 /**************************************************************************************/
28862 /**************************************************************************************/
28863 /* Section: Data Types */
28864 /**************************************************************************************/
28865 /**************************************************************************************/
28866 
28867 typedef
28868 float
28869  float32_t ;
28870 /**************************************************************************************/
28871 /*FSK states
28872  Summary:
28873  FSK states enumeration
28874  Description:
28875  This enumeration defines the valid FSK states. These states
28876  determine the behavior of the FSK state machine at various times.
28877 */
28878 
28879 typedef
28880  enum
28881  {
28888  } FSK_STATES ;
28889 /**************************************************************************************/
28890 /* FSK_DATA
28891  Summary:
28892  Holds FSK_DATA used for the FSK tasks.
28893  Description:
28894  Holds FSK_DATA used for the FSK tasks. The state machine and variables
28895  used to control FSK functions are stored here.
28896  Remarks:
28897  None
28898  */
28899 
28900 typedef
28901  struct
28902  {
28903  FSK_STATES state ;
28904  uint8_t crc ;
28905  uint8_t null_count ;
28906  bool send_message_complete_flag ;
28907  bool tick ;
28908  float32_t baud ;
28909  float32_t fsk_timer_freq ;
28910  float32_t mark_count ;
28911  float32_t space_count ;
28912  float32_t TABLE_MOD [ 50 ] ;
28913  uint8_t table_count ;
28914  } FSK_DATA ;
28915 
28916 extern FSK_DATA
28917  FSK ;
28918  /**************************************************************************************/
28919 
28920 typedef
28921  union /* Union defining the PerfSwitch message component lengths.*/
28922  {
28923  uint32_t dword ;
28924  uint16_t word ;
28925  uint8_t byte [ 4 ] ;
28926  } TMultiValue ;
28927 
28928 extern TMultiValue
28929  MESSAGE ;
28930 /**************************************************************************************/
28931 /**************************************************************************************/
28932 /* DOWN_MSG Data
28933  Summary:
28934  Holds DOWN_MSG data used for the FSK tasks.
28935  Description:
28936  Holds DOWN_MSG data used for the FSK tasks. The variables used to control FSK
28937  message are stored here.
28938  Remarks:
28939  None
28940  */
28941 
28942 typedef
28943  struct /* Structure defining the components of the FSK message to a PerfSwitch.*/
28944  {
28945  uint8_t identifier ;
28946  uint8_t command ;
28947  uint8_t msg_length ;
28948  uint8_t xmit_ready_flag ;
28949  } DOWN_MSG ;
28950 
28951 extern DOWN_MSG
28952  DWNMSG ;
28953 /**************************************************************************************/
28954 /*MSG states
28955  Summary:
28956  MSG states enumeration
28957  Description:
28958  This enumeration defines the valid MSG states. These states
28959  determine the behavior of the MSG state machine at various times. This machine
28960  also controls access to the PRE_MSG state machine.
28961 */
28962 
28963 typedef
28964  enum
28965  {
28971  } MSG_STATES ;
28972 /**************************************************************************************/
28973 /* MSG_DATA
28974  Summary:
28975  Holds MSG_DATA used for the MSG tasks.
28976  Description:
28977  Holds MSG_DATA used for the MSG tasks. The state machine and variables
28978  used to control MSG functions are stored here.
28979  Remarks:
28980  None
28981  */
28982 
28983 typedef
28984  struct
28985  {
28986  MSG_STATES state ;
28987  uint32_t command ;
28988  uint8_t length ;
28989  } MSG_DATA ;
28990 
28991 extern MSG_DATA
28992  MSG ;
28993 /**************************************************************************************/
28994 /*PREAMBLE states
28995  Summary:
28996  PRE_MSG states enumeration
28997  Description:
28998  This enumeration defines the valid PREAMBLE states. These states
28999  determine the behavior of the PREAMBLE state machine at various times. This is
29000  accessed from the MSG_STATE machine.
29001 */
29002 
29003 typedef
29004  enum
29005  {
29012  } PREAMBLE_STATES ;
29013 /**************************************************************************************/
29014 /* PRE_DATA
29015  Summary:
29016  Holds PRE_MSG_DATA used for the PRE_MSG tasks.
29017  Description:
29018  Holds PRE_MSG_DATA used for the PRE_MSG tasks. The state machine and variables
29019  used to control PRE_MSG functions are stored here.
29020  Remarks:
29021  None
29022  */
29023 
29024 typedef
29025  struct
29026  {
29027  PREAMBLE_STATES state ;
29028  } PRE_DATA ;
29029 
29030 extern PRE_DATA
29031  PRE_MSG ;
29032 
29033 static const uint8_t
29034  Xmit11 [ 312 ] = /* Array for the FSK frequency generation for a 'Mark'.*/
29035  { 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U ,
29036  0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U
29037  , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U ,
29038  0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U
29039  , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U ,
29040  0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U
29041  , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U ,
29042  0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU
29043  , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU ,
29044  0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U
29045  , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U } ;
29046 
29047 static const uint8_t
29048  Xmit00 [ 168 ] = /* Array for the FSK frequency generation for a 'Space'.*/
29049  { 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U ,
29050  0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U
29051  , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U ,
29052  0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U
29053  , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U , 0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U , 0x7FU , 0x99U , 0xB1U ,
29054  0xC6U , 0xD6U , 0xE0U , 0xE3U , 0xE0U , 0xD6U , 0xC6U , 0xB1U , 0x99U , 0x80U , 0x66U , 0x4EU , 0x39U , 0x29U , 0x1FU , 0x1BU , 0x1EU , 0x28U , 0x38U , 0x4CU , 0x65U } ;
29055 /**************************************************************************************/
29056 /**************************************************************************************/
29057 /* External Functions */
29058 /**************************************************************************************/
29059 /**************************************************************************************/
29060 /*!*************************************************************************************
29061  Function:
29062  void Prepare_Dwn_Msg( uint8_t Identifier, uint8_t Cmd, uint8_t Msg_Length )
29063  Summary:
29064  Receives information from the command parser and stores it into the DwnMsg (FSK)
29065  structure for transmission by FSK.
29066  Description:
29067  Receives information from the command parser and stores it into the DwnMsg (FSK)
29068  structure for transmission by FSK. No other action is performed on the data here.
29069  The DwnMsg (FSK) elements can be manipulated prior to the FSK transmission to
29070  create the final MESSAGE array for longer commands.
29071 
29072  Precondition:
29073  None.
29074  Parameters:
29075  uint8_t Identifier: The lower 3 bits of Frame 4 from the Protocol B command.
29076  uint8_t Cmd: Frame 0 from the Protocol B command.
29077  uint8_t msgLength: The FSK message length in bits.
29078  Returns
29079  None.
29080 
29081  Remarks
29082  None.
29083 
29084  Example:
29085  Prepare_Dwn_Msg(ident,cmd, 20)
29086  */
29087 
29088 void
29089  Prepare_Dwn_Msg (
29090  uint8_t Identifier ,
29091  uint8_t Cmd ,
29092  uint8_t Msg_Length ) ;
29093 /*!*************************************************************************************
29094  Function:
29095  void Generate_Sine_Wave_Data( float32_t NoOfTicks )
29096  Summary:
29097  This function stores sine wave inter step time values into two arrays at
29098  initialization and if the FSK frequency needs to be adjusted. These values
29099  represent the amount of time between updates of the sine wave data DAC used to
29100  generate a 1 or 0.
29101  Description:
29102  This function stores sine wave inter step time values into two arrays at
29103  initialization and if the FSK frequency needs to be adjusted. The TimeMark array
29104  is for the time between a 'MARK' update and the TimeSpace array is for the time
29105  between a 'SPACE' update. Changing the time between the updates will effectively
29106  change the transmitted frequency for a 'MARK' or 'SPACE'. This occurs if there
29107  are errors during the data transmission to a PerfSwitch. This can occur as the
29108  PerfSwitch gets hot when it is down hole.
29109 
29110  Precondition:
29111  None.
29112  Parameters:
29113  float32_t NoOfTicks: This is an error factor used to correct the inter step
29114  time values.
29115  Returns
29116  None.
29117 
29118  Remarks
29119  None.
29120 
29121  Example:
29122  void GenerateSineWaveData( float32_t NoOfTicks )
29123  */
29124 
29125 void
29127  float32_t NoOfTicks ) ;
29128 /**************************************************************************************/
29129 /**************************************************************************************/
29130 /* Local Functions */
29131 /**************************************************************************************/
29132 /**************************************************************************************/
29133 /*!*************************************************************************************
29134  Function:
29135  static void Init_FSK( void )
29136  Summary:
29137  Function to initialize the FSK parameters.
29138  Description:
29139  Function to initialize the FSK parameters. All of the flags and table data are
29140  set to their initial condition. Timer 2 is also started. It is set to 160nS and
29141  is used to count the time between the Manchester transitions.
29142 
29143  Precondition:
29144  None.
29145  Parameters:
29146  None.
29147  Returns:
29148  None.
29149 
29150  Remarks:
29151  None.
29152 
29153  Example:
29154  Init_FSK()
29155  */
29156 
29157 static void
29158  Init_FSK ( void ) ;
29159 /*!*************************************************************************************
29160  Function:
29161  static void Send_Space( void )
29162  Summary:
29163  This function sends a FSK 0 or 'SPACE'.
29164  Description:
29165  This function sends a FSK 0 or 'SPACE'. It is called from the SendMessage
29166  function. sendSpace reads the Xmit00 array and sends the data to the FSK DAC.
29167  The time between the updates is controlled by a timer matching the corresponding
29168  value of the TimeSpace array. An FSK 'zero' is approximately 2800 Hz with
29169  7 cycles lasting approximately 2.5 ms.
29170 
29171  Precondition:
29172  None.
29173  Parameters:
29174  None.
29175  Returns
29176  None.
29177 
29178  Remarks
29179  None.
29180 
29181  Example:
29182  SendSpace()
29183  */
29184 
29185 static void
29186  Send_Space ( void ) ;
29187 /*!*************************************************************************************
29188  Function:
29189  static void Send_Mark( void )
29190  Summary:
29191  This function sends a FSK 1 or 'MARK'.
29192  Description:
29193  This function sends a FSK 1 or 'MARK'. It is called from the Send_Message_Task
29194  function. Send_Mark reads the Xmit11 array and sends the data to the FSK DAC.
29195  The time between the updates is controlled by a timer matching the corresponding
29196  value of the TimeMark array. An FSK 'one' is approximately 5200 Hz with
29197  13 cycles lasting approximately 2.5 ms.
29198 
29199  Precondition:
29200  None.
29201  Parameters:
29202  None.
29203  Returns
29204  None.
29205 
29206  Remarks
29207  None.
29208 
29209  Example:
29210  sendMark()
29211  */
29212 
29213 static void
29214  Send_Mark ( void ) ;
29215 /**************************************************************************************/
29216 /**************************************************************************************/
29217 /* State Machine Functions */
29218 /**************************************************************************************/
29219 /**************************************************************************************/
29220 /*!*************************************************************************************
29221  Function:
29222  void FSK_Tasks(void)
29223  Summary:
29224  FSK_Tasks function
29225  Description:
29226  This routine is the FSK_Tasks function. It defines the FSK_Tasks state
29227  machine and core logic. This machine is used to send an FSK message to a
29228  PerfSwitch. It checks to see if there is a message for Tx and decides if it is a
29229  short or a long message. For a long message, it calculates the CRC and appends
29230  it to the Message and calls Send_Message_Tasks. If a good Manchester response is
29231  received, it resets all flags and prepares to send another message. Otherwise,
29232  it prepares to resend the previous message at a corrected frequency.
29233 
29234  Precondition:
29235  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
29236  should be called before calling this.
29237  Parameters:
29238  None.
29239  Returns:
29240  None.
29241  Remarks:
29242  This routine must be called from the APP_Tasks() routine.
29243  Example:
29244  FSK_Tasks()
29245  */
29246 
29247 void
29248  FSK_Tasks ( void ) ;
29249 /*!*************************************************************************************
29250  Function:
29251  static void Send_Message_Tasks(void)
29252  Summary:
29253  Send_Message_Tasks function
29254  Description:
29255  This routine is the Send_Message_Tasks function. It defines the Send_Message_Tasks
29256  state machine and core logic. This machine is used to send an FSK message to a
29257  PerfSwitch. It can control the MAnchester bias DAC. It then controls the PREAMBLE
29258  (PRE_MSG) state machine to send the preamble. Then the actual message is sent.
29259  Precondition:
29260  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
29261  should be called before calling this.
29262  Parameters:
29263  None.
29264  Returns:
29265  None.
29266  Remarks:
29267  This routine must be called from the FSK_Tasks() routine.
29268  Example:
29269  Send_Message_Tasks()
29270  */
29271 
29272 static void
29273  Send_Message_Tasks ( void ) ;
29274  /* FSK_H */
29275 /***************************************************************************************
29276  End of File
29277  */
29278 
29279 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fsk.h*/
29280 /* CLOSE_FILE Include File */
29281 
29282 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h */
29283 /**************************************************************************************/
29297 /**************************************************************************************/
29298 #ifndef MAN_H /* Guard against multiple inclusion.*/
29299 #define MAN_H
29300 /**************************************************************************************/
29301 /**************************************************************************************/
29302 /* Section: Included Files */
29303 /**************************************************************************************/
29304 /**************************************************************************************/
29305 #include <stdbool.h>
29306 #include "../system_config.h"
29307 #include "../system_definitions.h"
29308 /**************************************************************************************/
29309 /**************************************************************************************/
29310 /* Section: Defines */
29311 /**************************************************************************************/
29312 /**************************************************************************************/
29313 /* Define the upper and lower bounds for Manchester data, TMR4 tick = 200nsec * 8 = 1.6usec */
29314 /* Define the upper and lower bounds for Manchester data, TMR2 tick = 10nS * 16 = 160nS. */
29315 //#define ManHalfUpper 1171 /* 1.8736 mS.*/
29316 //#define ManHalfLower 500 /* 0.8 mS.*/
29317 //#define ManFullUpper 1953 /* 3.12148 mS.*/
29318 //#define ManFullLower 1172 /* 1.8752 mS.*/
29319 //#define ManHalfUpper 6400 /* 1.8736 mS.?*/ /* time div = 32*/
29320 //#define ManHalfLower 1000 /* 0.8 mS.?*/
29321 //#define ManFullUpper 10000 /* 3.12148 mS.?*/
29322 //#define ManFullLower 6401 /* 1.8752 mS.?*/
29323 #define ManHalfUpper 11800U
29324 #define ManHalfLower 2000U
29325 #define ManFullUpper 20000U
29326 #define ManFullLower 11801U
29327 #define NoManBits 32U
29328 #define HalfBit 0x12U
29329 #define FullBit 0x10U
29330 #define SizeOfBiasLUT 48U
29331 /**************************************************************************************/
29332 /**************************************************************************************/
29333 /* Section: Data Types */
29334 /**************************************************************************************/
29335 /**************************************************************************************/
29336 
29337 typedef
29338 float
29339  float32_t ;
29340 /**************************************************************************************/
29341 /* MAN states
29342  Summary:
29343  MAN states enumeration
29344  Description:
29345  This enumeration defines the valid MAN states. These states determine the
29346  behavior of the MAN state machine at various times. This machine controls when
29347  the MAN_RX and MAN_PROCESS machines execute their states.
29348 */
29349 
29350 typedef
29351  enum
29352  {
29359  } MAN_STATES ;
29360 /**************************************************************************************/
29361 /* MAN_RX_STATES
29362  Summary:
29363  MAN_RX_STATES enumeration
29364  Description:
29365  This enumeration defines the valid MAN_RX_STATES. These states determine the
29366  behavior of the MAN_RX_STATES machine at various times. This machine receives
29367  the data from a PerfSwtich.
29368 */
29369 
29370 typedef
29371  enum
29372  {
29376  } MAN_RX_STATES ;
29377 /**************************************************************************************/
29378 /* MAN_PROCESS_STATES
29379  Summary:
29380  MAN_PROCESS_STATES enumeration
29381  Description:
29382  This enumeration defines the valid MAN_PROCESS_STATES. These states
29383  determine the behavior of the MAN_PROCESS_STATES machine at various times.
29384 */
29385 
29386 typedef
29387  enum
29388  {
29392  } MAN_PROCESS_STATES ;
29393 /**************************************************************************************/
29394 /* MAN_DATA
29395  Summary:
29396  Holds MAN_DATA used for the Manchester tasks.
29397  Description:
29398  Holds MAN_DATA used for the Manchester tasks. The state machines and variables
29399  used to control Manchester functions are stored here.
29400  Remarks:
29401  None
29402  */
29403 
29404 typedef
29405  struct
29406  {
29410  uint16_t preamble [ 5 ] ;
29411  uint16_t time [ 96 ] ;
29412  uint8_t level [ 96 ] ;
29413  uint8_t ans [ 32U + 2 ] ;
29414  uint8_t msg [ 4 ] ;
29415  uint8_t cnt_preamble ;
29416  uint8_t trynumber ;
29420  uint8_t timer_count ;
29421  uint8_t timer_complete ;
29422  bool tick ;
29423  bool bad_crc ;
29424  bool error ;
29426  uint8_t crc ;
29427  } MAN_DATA ;
29428 
29429 extern MAN_DATA
29430  MAN ;
29431 /**************************************************************************************/
29432 /* MAN_BIAS_DATA
29433  Summary:
29434  Holds MAN_BIAS_DATA
29435  Description:
29436  This structure holds the MAN_BIAS_DATA. It is used to adjust the bias value of
29437  the Manchester DAC.
29438  Remarks:
29439  None
29440  */
29441 
29442 typedef
29443  struct
29444  {
29448  uint16_t adj [ 1 ] ;
29449  uint16_t dac_a_setting ;
29450  uint16_t dac_b_setting ;
29457  uint8_t index ;
29458  } MAN_BIAS_DATA ;
29459 
29460 extern MAN_BIAS_DATA
29461  MAN_BIAS ;
29462 /**************************************************************************************/
29463 /**************************************************************************************/
29464 /* Local Functions */
29465 /**************************************************************************************/
29466 /**************************************************************************************/
29467 /*!*************************************************************************************
29468  Function:
29469  static void Init_Manchester( void )
29470  Summary:
29471  Function to initialize the Manchester parameters.
29472  Description:
29473  Function to initialize the Manchester parameters.
29474 
29475  Precondition:
29476  None.
29477  Parameters:
29478  None.
29479  Returns:
29480  None.
29481 
29482  Remarks:
29483  None.
29484 
29485  Example:
29486  Init_Manchester()
29487  */
29488 
29489 static void
29490  Init_Manchester ( void ) ;
29491 /*!*************************************************************************************
29492  Function:
29493  static bool Check_Manchester( void )
29494  Summary:
29495  This routine checks for valid Manchester response.
29496  Description:
29497  This routine checks for valid Manchester response. The first two bytes are
29498  checked. If both are zero, then we did not receive a valid response. This is
29499  used in the function Test_Manchester.
29500 
29501  Precondition:
29502  None.
29503  Parameters:
29504  None.
29505  Returns:
29506  bool ans
29507 
29508  Remarks:
29509  None.
29510 
29511  Example:
29512  if( Check_Manchester( ) == true )
29513  */
29514 
29515 static bool
29516  Check_Manchester ( void ) ;
29517 /*!*************************************************************************************
29518  Function:
29519  static void Decode_Manchester( void )
29520  Summary:
29521  Function to decode the Manchester response from a PerfSwitch.
29522  Description:
29523  Function to decode the Manchester response from a PerfSwitch. The MAN.level
29524  and MAN.time arrays are used to generate the MAN.ANS array.
29525  MAN.level[] - level of the incoming data.
29526  MAN.time[] - time of corresponding wave timer ticks.
29527 
29528  The last 1 of the preamble is always in the data so we have a fixed starting point.
29529 
29530  Precondition:
29531  None.
29532  Parameters:
29533  None.
29534  Returns:
29535  None.
29536 
29537  Remarks:
29538  None.
29539 
29540  Example:
29541  Decode_Manchester()
29542  */
29543 
29544 static void
29545  Decode_Manchester ( void ) ;
29546 /*!*************************************************************************************
29547  Function:
29548  static void Package_Manchester( void )
29549  Summary:
29550  Function to prepare Manchester response for further processing.
29551  Description:
29552  Function to prepare Manchester response for further processing. The Manchester
29553  response is decoded and the 1 X 32 answer array is packed into a 4 X 8 bit
29554  message array.
29555 
29556  Precondition:
29557  None.
29558  Parameters:
29559  None.
29560  Returns:
29561  None.
29562 
29563  Remarks:
29564  None.
29565 
29566  Example:
29567  Package_Manchester()
29568  */
29569 
29570 static void
29571  Package_Manchester ( void ) ;
29572 /*!*************************************************************************************
29573  Function:
29574  static void Test_Manchester (void)
29575  Summary:
29576  Function to test the returned Manchester message.
29577  Description:
29578  Function to test the returned Manchester message. The first two bytes are checked
29579  to make sure they are not both 0. If they are not, the FSK frequencies are
29580  adjusted, and the CRC is checked. If the CRC is a match, then a response message
29581  to the host is prepared. Otherwise, up to two different FSK frequencies are
29582  tried in order to establish communications with a PerfSwitch.
29583 
29584  Precondition:
29585  None.
29586  Parameters:
29587  None.
29588  Returns:
29589  None.
29590 
29591  Remarks:
29592  None.
29593 
29594  Example:
29595  Test_Manchester ()
29596  */
29597 
29598 static void
29599  Test_Manchester ( void ) ;
29600 /*!*************************************************************************************
29601  Function:
29602  static void Flush_Buffer_Manchester( void )
29603  Summary:
29604  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
29605  Description:
29606  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
29607  These are flushed after every reception.
29608 
29609  Precondition:
29610  None.
29611  Parameters:
29612  None.
29613  Returns:
29614  None.
29615 
29616  Remarks:
29617  None.
29618 
29619  Example:
29620  Flush_Buffer_Manchester()
29621  */
29622 
29623 static void
29624  Flush_Buffer_Manchester ( void ) ;
29625 /*!*************************************************************************************
29626  Function:
29627  static float32_t Calc_Fsk_Scaling( void )
29628  Summary:
29629  Function to calculate the amount of FSK adjustment needed based on the preamble bit
29630  timer counts.
29631  Description:
29632  Function to calculate the amount of FSK adjustment needed based on the preamble bit
29633  timer counts. The average of the timer counts is used to determine the amount
29634  of adjustment. The result is a multiplier used in the Generate_Sine_Wave _Data
29635  function to change the amount of time between the FSK DAC updates. Adjustments
29636  up to 10% have been seen in temperature testing. Adjustments are generally
29637  greater than 1 when a PerfSwitch is hot and less than 1 when a PerfSwitch is cold.
29638 
29639  Precondition:
29640  None.
29641  Parameters:
29642  None.
29643  Returns:
29644  None.
29645 
29646  Remarks:
29647  None.
29648 
29649  Example:
29650  CalcFskScaling( )
29651  */
29652 
29653 static float32_t
29654  Calc_Fsk_Scaling ( void ) ;
29655 /**************************************************************************************/
29656 /**************************************************************************************/
29657 /* Interface Functions */
29658 /**************************************************************************************/
29659 /**************************************************************************************/
29660 /*!*************************************************************************************
29661  Function:
29662  void Calc_Auto_Bias(void)
29663  Summary:
29664  Function to calculate the amount of bias adjust required and to transmit that
29665  result via a SPI port to the Manchester bias DAC.
29666  Description:
29667  Function to calculate the amount of bias adjust required and to transmit that
29668  result via a SPI port to the Manchester bias DAC.
29669 
29670  Precondition:
29671  None.
29672  Parameters:
29673  None.
29674  Returns:
29675  None.
29676 
29677  Remarks:
29678  None.
29679 
29680  Example:
29681  CalcAutoBias()
29682  */
29683 
29684 void
29685  Calc_Auto_Bias ( void ) ;
29686 /*!*************************************************************************************
29687  Function:
29688  void Set_Bias(uint8_t value)
29689  Summary:
29690  Function to transmit the bias adjust value via an SPI port to the Manchester
29691  bias DAC.
29692  Description:
29693  Function to transmit the bias adjust value via an SPI port to the Manchester
29694  bias DAC. Value is integer between 0 and 47. Values greater than 47 are set to 47.
29695 
29696  Precondition:
29697  None.
29698  Parameters:
29699  uint8_t value
29700  Returns:
29701  None.
29702 
29703  Remarks:
29704  None.
29705 
29706  Example:
29707  Set_Bias(uint8_t value)
29708  */
29709 
29710 void
29711  Set_Bias (
29712  uint8_t value ) ;
29713 /**************************************************************************************/
29714 /**************************************************************************************/
29715 /* State Machine Functions */
29716 /**************************************************************************************/
29717 /**************************************************************************************/
29718 /*!*************************************************************************************
29719  Function:
29720  void MAN_Tasks(void)
29721  Summary:
29722  MAN tasks function
29723  Description:
29724  This routine is the MAN tasks function. It defines the MAN's state machine and
29725  core logic. This machine controls the MAN operation and sets flags indicating
29726  new values are available from the system interrupt routine for use in other parts
29727  of the application. It also controls when the MAN_Process_Tasks machine and
29728  MAN_RX_Tasks machines operate.
29729  Precondition:
29730  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
29731  should be called before calling this.
29732  Parameters:
29733  None.
29734  Returns:
29735  None.
29736  Example:
29737  MAN_Tasks()
29738 
29739  Remarks:
29740  This routine must be called from the APP_Tasks() routine.
29741  */
29742 
29743 void
29744  MAN_Tasks ( void ) ;
29745 /*!*************************************************************************************
29746  Function:
29747  static void MAN_PROCESS_Tasks(void)
29748  Summary:
29749  MAN_PROCESS tasks function
29750  Description:
29751  This routine is the MAN_PROCESS tasks function. It defines the MAN_PROCESS's
29752  state machine and core logic. This machine controls the MAN_Process operation. It
29753  decodes, packages, tests and prepares for another message to process.
29754 
29755  During packaging, the 32 bit Manchester response is packaged into a 4 byte array.
29756 
29757  During testing, the CRC is checked and the appropriate response is prepared to
29758  send to the host. If a bad response was received, the FSK frequencies are adjusted
29759  and two more attempts are made to retrieve a valid response.
29760 
29761  Precondition:
29762  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
29763  should be called before calling this.
29764  Parameters:
29765  None.
29766  Returns:
29767  None.
29768  Example:
29769  MAN_PROCESS_Tasks()
29770 
29771  Remarks:
29772  This routine must be called from the MAN_Tasks() routine.
29773  */
29774 
29775 static void
29776  MAN_PROCESS_Tasks ( void ) ;
29777 /*!*************************************************************************************
29778  Function:
29779  void MAN_RX_Tasks(void)
29780  Summary:
29781  MAN_Rx tasks function
29782  Description:
29783  This routine is the MAN_Rx tasks function. It defines the MAN_Rx's
29784  state machine and core logic. It determines if a proper message preamble has
29785  been received and determines the time and input level state when a transition
29786  occurs. This routine is called when there is a high to low change on the port pin.
29787 
29788  The state MAN_RX_STATE_IDLE has no effect on Manchester processing.
29789  The state MAN_RX_STATE_PREAMBLE is responsible for syncing up to a 1111.
29790  The state MAN_RX_STATE_DATA receives the data. The time ranges allow for variances
29791  between PerfSwitches and how they perform over temperature.
29792 
29793  Precondition:
29794  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
29795  should be called before calling this.
29796  Parameters:
29797  None.
29798  Returns:
29799  None.
29800  Example:
29801  MAN_RX_Tasks()
29802 
29803  Remarks:
29804  This routine must be called from the MAN_Tasks() routine.
29805  */
29806 
29807 void
29808  MAN_RX_Tasks ( void ) ;
29809  /* MAN_H */
29810 /***************************************************************************************
29811  End of File
29812  */
29813 
29814 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h*/
29815 /* CLOSE_FILE Include File */
29816 
29817 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fifo.h */
29818 /**************************************************************************************/
29832 /**************************************************************************************/
29833 #ifndef FIFO_H /* Guard against multiple inclusion */
29834 #define FIFO_H
29835 /**************************************************************************************/
29836 /**************************************************************************************/
29837 /* Section: Included Files */
29838 /**************************************************************************************/
29839 /**************************************************************************************/
29840 #include <stdbool.h>
29841 #include <stdint.h>
29842 /**************************************************************************************/
29843 /**************************************************************************************/
29844 /* Section: Defines */
29845 /**************************************************************************************/
29846 /**************************************************************************************/
29847 #define FIFO_RX_SIZE 7
29848 #define FIFO_TX_SIZE 7
29849  /* FifoPut Return values.*/
29850 #define FIFO_ADD_OK 0
29851 #define FIFO_FULL 1
29852  /* FifoGet Return Value.*/
29853 #define FIFO_EMPTY 2U
29854 /**************************************************************************************/
29855 /**************************************************************************************/
29856 /* Section: Data Types */
29857 /**************************************************************************************/
29858 /**************************************************************************************/
29859 
29860 typedef
29861  struct
29862  {
29863  uint8_t length ;
29864  uint8_t * ptr_buffer ;
29866  /* Filled in by the FIFO functions.*/
29867  uint8_t head ;
29868  uint8_t tail ;
29869  uint8_t num_records ;
29870  uint8_t put_error ;
29871  uint8_t get_error ;
29872  bool fEmpty ;
29873  bool fFull ;
29874  } TFifo ;
29875 
29876 extern TFifo
29877  RX_FIFO ; /* This structure is used for both the RxFifo and TxFifo.*/
29878 
29879 extern TFifo
29880  TX_FIFO ;
29881 /**************************************************************************************/
29882 /**************************************************************************************/
29883 /* Section: Local Functions */
29884 /**************************************************************************************/
29885 /**************************************************************************************/
29886 /*!*************************************************************************************
29887  Function:
29888  static void Fifo_Init( TFifo *ptrFifo, unsigned char *ptrBuffer, int Length )
29889  Summary:
29890  This function initializes a given Fifo.
29891  Description:
29892  This function initializes the communication Fifo. It is used to initialize both
29893  the transmit and receive Fifo's.
29894 
29895  Precondition:
29896  None.
29897  Parameters:
29898  None.
29899  Returns
29900  None.
29901 
29902  Remarks:
29903  None.
29904 
29905  Example:
29906  Fifo_Init( &RX_FIFO, FifoRxBuffer, FIFO_RX_SIZE )
29907  */
29908 
29909 static void
29910  Fifo_Init (
29911  TFifo * ptrFifo ,
29912  uint8_t * ptrBuffer ,
29913  uint16_t Length ) ;
29914 /**************************************************************************************/
29915 /**************************************************************************************/
29916 /* Section: Interface Functions */
29917 /**************************************************************************************/
29918 /**************************************************************************************/
29919 /*!*************************************************************************************
29920  Function:
29921  void Init_Fifo(void)
29922  Summary:
29923  This function calls the function Fifo_Init to initialize the RxFifo and TxFifo.
29924  Description:
29925  This function calls the function Fifo_Init to initialize the RxFifo and TxFifo.
29926  This function is called in APP_Initialize in app.c
29927 
29928 
29929  Precondition:
29930  None.
29931  Parameters:
29932  None.
29933  Returns
29934  None.
29935 
29936  Remarks:
29937  None.
29938 
29939  Example:
29940  Init_Fifo()
29941  */
29942 
29943 void
29944  Init_Fifo ( void ) ;
29945 /*!*************************************************************************************
29946  Function:
29947  uint8_t Fifo_Put( TFifo *ptrFifo, uint8_t Data )
29948  Summary:
29949  Function to add an entry (byte)to a Fifo.
29950  Description:
29951  Function to add an entry (byte)to a Fifo. If the Fifo is full then the function
29952  returns FIFO_FULL, otherwise the function adds the entry to the FifoBuffer,
29953  increments FifoHead and returns FIFO_ADD_OK.
29954 
29955  Precondition:
29956  None.
29957  Parameters:
29958  uint8_t Data: The byte of data to be added.
29959  TFifo *ptrFifo: The pointer to the Fifo that is being manipulated.
29960  Returns
29961  integer value. Fifo_Full or FIFO_ADD_OK
29962 
29963  Remarks:
29964  None.
29965 
29966  Example:
29967  Fifo_Put( &TX_FIFO, b_comm_crc )
29968  */
29969 
29970 uint8_t
29971  Fifo_Put (
29972  TFifo * ptrFifo ,
29973  uint8_t Data ) ;
29974 /*!*************************************************************************************
29975  Function:
29976  uint8_t Fifo_Get( TFifo *ptrFifo )
29977  Summary:
29978  Function to retrieve an entry from Fifo.
29979  Description:
29980  Function to retrieve an entry from Fifo. If Fifo is empty then function returns
29981  FIFO_EMPTY. Otherwise, the function returns the oldest entry in FifoBuffer and
29982  increments FifoTail.
29983 
29984  Precondition:
29985  None.
29986  Parameters:
29987  TFifo *ptrFifo
29988  Returns
29989  uint8_t Contents of Fifo buffer.
29990 
29991  Remarks:
29992  None.
29993 
29994  Example:
29995  temp = Fifo_Get( &RX_FIFO )
29996  */
29997 
29998 uint8_t
29999  Fifo_Get (
30000  TFifo * ptrFifo ) ;
30001 /*!*************************************************************************************
30002  Function:
30003  uint8_t Fifo_Length( TFifo *ptrFifo )
30004  Summary:
30005  Function to find the length of the buffer.
30006  Description:
30007  Function to find the length of the buffer.
30008 
30009  Precondition:
30010  None.
30011  Parameters:
30012  TFifo *ptrFifo: The pointer to the Fifo.
30013  Returns
30014  uint8_t. Length of the fifo buffer.
30015 
30016  Remarks:
30017  None.
30018 
30019  Example:
30020  if( Fifo_Length( &RX_FIFO ) == CMD.cmd_size )
30021  */
30022 
30023 uint8_t
30024  Fifo_Length (
30025  TFifo * ptrFifo ) ;
30026  /* FIFO_H */
30027 /***************************************************************************************
30028  End of File
30029  */
30030 
30031 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fifo.h*/
30032 /* CLOSE_FILE Include File */
30033 
30034 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h */
30035 /**************************************************************************************/
30049 /**************************************************************************************/
30050 #ifndef COMMANDS_H /* Guard against multiple inclusion.*/
30051 #define COMMANDS_H
30052 /**************************************************************************************/
30053 /**************************************************************************************/
30054 /* Section: Included Files */
30055 /**************************************************************************************/
30056 /**************************************************************************************/
30057 #include <stdbool.h>
30058 #include <stdint.h>
30059 /**************************************************************************************/
30060 /**************************************************************************************/
30061 /* Section: Global Variables */
30062 /**************************************************************************************/
30063 /**************************************************************************************/
30064 
30065 extern bool
30066  DepthStatus ;
30067 /**************************************************************************************/
30068 /**************************************************************************************/
30069 /* Section: Type Definition */
30070 /**************************************************************************************/
30071 /**************************************************************************************/
30072 
30073 typedef
30074 unsigned char
30076 /**************************************************************************************/
30077 /**************************************************************************************/
30078 /* Section: Data Types */
30079 /**************************************************************************************/
30080 /**************************************************************************************/
30081 /**************************************************************************************/
30082 
30083 typedef
30084  enum
30085  {
30090  } COMMAND_STATES ;
30091 
30092 typedef
30093  struct /* This structure collects the variables and states required for these*/
30094  {
30095  /* functions to operate.*/
30096  COMMAND_STATES state ;/* The COMMAND_TASKS machine current state.*/
30097  uint16_t crc ;
30098  uint8_t cmd_size ;
30099  uint8_t command [ 7 ] ;
30100  bool process_complete_flag ;
30101  bool b_command_complete_flag ;
30102  bool sw_status_bit_check ;
30103  } COMMAND_DATA ;
30104 
30105 extern COMMAND_DATA
30106  CMD ;
30107 /**************************************************************************************/
30108 /**************************************************************************************/
30109 /* Section: Interface Functions */
30110 /**************************************************************************************/
30111 /**************************************************************************************/
30112 /*!*************************************************************************************
30113  Function:
30114  void COMMAND_Tasks( void )
30115  Summary:
30116  This function executes the commands from the host.
30117  Description:
30118  This function executes the commands from the host. It does this by first ensuring
30119  the CRC of the received command is correct. If the CRC check matches, it goes on
30120  to execute the command. The commands are divided up into three types; Protocol A,
30121  Protocol B and System. Protocol A commands control the function of the Panel
30122  Interface Board. Protocol B commands are for a PerfSwitch or other down hole tool.
30123  System commands control the panel operation while it is being used for shooting.
30124  An example would be showing the depth status.
30125 
30126  Precondition:
30127  None.
30128  Parameters:
30129  None.
30130  Returns
30131  None.
30132 
30133  Remarks:
30134  None.
30135 
30136  Example:
30137  void COMMAND_Tasks()
30138  */
30139 
30140 void
30141  COMMAND_Tasks ( void ) ;
30142 /**************************************************************************************/
30143 /**************************************************************************************/
30144 /* Section: Local Functions */
30145 /**************************************************************************************/
30146 /**************************************************************************************/
30147 /*!*************************************************************************************
30148  Function:
30149  bool Valid_Command( uchar8_t msg )
30150  Summary:
30151  This function compares the received command(first byte)and compares it to a list
30152  of correct commands.
30153  Description:
30154  This function compares the received command(first byte)and compares it to a list
30155  of correct commands. If there is a match, the rest of the transmission is
30156  received for processing. Used in the ValidateComm function in commmodule.c
30157 
30158  Precondition:
30159  None.
30160  Parameters:
30161  uchar8_t msg - The one byte command to compare.
30162  Returns
30163  bool ans - true if command is valid.
30164 
30165  Remarks
30166  None.
30167 
30168  Example:
30169  Valid_Command( command )
30170  */
30171 
30172 bool
30173  Valid_Command (
30174  uchar8_t msg ) ;
30175 /*!*************************************************************************************
30176  Function:
30177  bool GetDepthStatus ( void )
30178  Summary:
30179  This function compares the received command(first byte)and compares it to a list
30180  of correct commands.
30181  Description:
30182  This function compares the received command(first byte)and compares it to a list
30183  of correct commands. If there is a match, the rest of the transmission is
30184  received for processing. Used in the ValidateComm function in commmodule.c
30185 
30186  Precondition:
30187  None.
30188  Parameters:
30189  unsigned char msg - The one byte command to compare.
30190  Returns
30191  unsigned short ans.
30192 
30193  Remarks
30194  None.
30195 
30196  Example:
30197  GetDepthStatus ( )
30198  */
30199 
30200 bool
30201  GetDepthStatus ( void ) ;
30202 /*!*************************************************************************************
30203  Function:
30204  static void Execute_Auto_Protocol_A (void)
30205  Summary:
30206  This function executes the Auto Protocol A commands.
30207  Description:
30208  This function executes the Auto Protocol A commands. These are commands that
30209  control the panel. The commands are listed as case statements. Once the action is
30210  completed, a response is generated and sent back to the host.
30211 
30212  Precondition:
30213  None.
30214  Parameters:
30215  None.
30216  Returns
30217  None.
30218 
30219  Remarks
30220  None.
30221 
30222  Example:
30223  Execute_Auto_Protocol_A ()
30224  */
30225 
30226 static void
30227  Execute_Auto_Protocol_A ( void ) ;
30228 /*!*************************************************************************************
30229  Function:
30230  static void Execute_Protocol_A (void)
30231  Summary:
30232  This function executes the Protocol A commands.
30233  Description:
30234  This function executes the Protocol A commands. These are commands that control
30235  the panel. The commands are listed as case statements. Once the action is
30236  completed, a response is generated and sent back to the host.
30237 
30238  Precondition:
30239  None.
30240  Parameters:
30241  None.
30242  Returns
30243  None.
30244 
30245  Remarks
30246  None.
30247 
30248  Example:
30249  ExecuteProtocolA ()
30250  */
30251 
30252 static void
30253  Execute_Protocol_A ( void ) ;
30254 /*!*************************************************************************************
30255  Function:
30256  static void Execute_Protocol_B (void)
30257  Summary:
30258  This function executes the Protocol B commands.
30259  Description:
30260  This function executes the Protocol B commands. These are commands that are for
30261  a PerfSwitch or other tool. The commands are listed as case statements. Once
30262  the action is completed, a response is generated and sent back to the host.
30263 
30264  Precondition:
30265  None.
30266  Parameters:
30267  None.
30268  Returns
30269  None.
30270 
30271  Remarks
30272  None.
30273 
30274  Example:
30275  ExecuteProtocolB ()
30276  */
30277 
30278 static void
30279  Execute_Protocol_B ( void ) ;
30280 /*!*************************************************************************************
30281  Function:
30282  static void Execute_System(void)
30283  Summary:
30284  This function executes the system commands.
30285  Description:
30286  This function executes the system commands. Once the action is completed, a
30287  response is generated and sent back to the host.
30288 
30289  Precondition:
30290  None.
30291  Parameters:
30292  None.
30293  Returns
30294  None.
30295 
30296  Remarks
30297  None.
30298 
30299  Example:
30300  ExecuteSystem()
30301  */
30302 
30303 static void
30304  Execute_System ( void ) ;
30305  /* COMMANDS_H */
30306 /***************************************************************************************
30307  End of File
30308  */
30309 
30310 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h*/
30311 /* CLOSE_FILE Include File */
30312 
30313 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\timers.h */
30314 /**************************************************************************************/
30329 /**************************************************************************************/
30330 #ifndef TIMERS_H /* Guard against multiple inclusion.*/
30331 #define TIMERS_H
30332 /**************************************************************************************/
30333 /**************************************************************************************/
30334 /* Section: Included Files */
30335 /**************************************************************************************/
30336 /**************************************************************************************/
30337 #include <stdint.h>
30338 #include <stdbool.h> /* Defines true.*/
30339 #include "../system_config.h"
30340 #include "../system_definitions.h"
30341 /**************************************************************************************/
30342 /**************************************************************************************/
30343 /* Section: Data Types */
30344 /**************************************************************************************/
30345 /**************************************************************************************/
30346 /**************************************************************************************/
30347 /* TIMER states
30348  Summary:
30349  TIMER states enumeration
30350  Description:
30351  This enumeration defines the valid TIMER states. These states
30352  determine the behavior of the TIMER state machine at various times.
30353 */
30354 
30355 typedef
30356  enum
30357  {
30361  } TIMER_STATES ;
30362 /**************************************************************************************/
30363 /* TIMER_DATA
30364  Summary:
30365  Holds TIMER_DATA used for the TIMER tasks.
30366  Description:
30367  Holds TIMER_DATA used for the TIMER tasks. The state machine and variables
30368  used to control TIMER functions are stored here.
30369  Remarks:
30370  None
30371  */
30372 
30373 typedef
30374  struct /* This structure collects the variables and states required for these*/
30375  {
30376  /* functions to operate.*/
30378  DRV_HANDLE tmrDrvHandle ;/* Pointer to Timer Driver returned by DRV_TMR_Open().*/
30389  } TIMER_DATA ;
30390 
30391 extern TIMER_DATA
30392  TIMER ;
30393 /**************************************************************************************/
30394 /**************************************************************************************/
30395 /* State Machine Functions */
30396 /**************************************************************************************/
30397 /**************************************************************************************/
30398 /*!*************************************************************************************
30399  Function:
30400  void TIMER_Tasks(void)
30401  Summary:
30402  TIMER_Tasks function.
30403  Description:
30404  This routine is the TIMER_Tasks function. It defines the TIMER state machine and
30405  core logic.
30406  Precondition:
30407  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
30408  should be called before calling this.
30409  Parameters:
30410  None.
30411  Returns:
30412  None.
30413  Example:
30414  TIMER_Tasks()
30415  Remarks:
30416  This routine must be called from APP_Tasks() routine.
30417  */
30418 
30419 void
30420  TIMER_Tasks ( void ) ;
30421  /* TIMERS_H */
30422 /***************************************************************************************
30423  End of File
30424  */
30425 
30426 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\timers.h*/
30427 /* CLOSE_FILE Include File */
30428 
30429 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\USB.h */
30430 /**************************************************************************************/
30445 /**************************************************************************************/
30446 #ifndef USB_H /* Guard against multiple inclusion */
30447 #define USB_H
30448 /**************************************************************************************/
30449 /**************************************************************************************/
30450 /* Section: Included Files */
30451 /**************************************************************************************/
30452 /**************************************************************************************/
30453 #include <stdint.h>
30454 #include <stdbool.h>
30455 #include <stddef.h>
30456 #include <stdlib.h>
30457 #include "system_config.h"
30458 #include "system_definitions.h"
30459 /**************************************************************************************/
30460 /**************************************************************************************/
30461 /* Section: Data Types */
30462 /**************************************************************************************/
30463 /**************************************************************************************/
30464 /**************************************************************************************/
30465 /* USB states
30466  Summary:
30467  USB states enumeration
30468  Description:
30469  This enumeration defines the valid USB states. These states
30470  determine the behavior of the USB state machine at various times.
30471 */
30472 
30473 typedef
30474  enum
30475  {
30484  } USB_STATES ;
30485 /**************************************************************************************/
30486 /* USB_DATA
30487  Summary:
30488  Holds USB_DATA used for the USB tasks.
30489  Description:
30490  Holds USB_DATA used for the USB tasks. The state machine and variables
30491  used to control USB functions are stored here.
30492  Remarks:
30493  None
30494  */
30495 
30496 typedef
30497  struct
30498  {
30500  USB_DEVICE_HANDLE usbDevHandle ;
30502  uint8_t configValue ;
30503  USB_SPEED speed ;
30506  USB_DEVICE_TRANSFER_HANDLE writeTranferHandle ;/* Write transfer handle.*/
30507  USB_DEVICE_TRANSFER_HANDLE readTranferHandle ;/* Read transfer handle.*/
30508  USB_ENDPOINT_ADDRESS endpointTx ;
30509  USB_ENDPOINT_ADDRESS endpointRx ;
30510  uint8_t altSetting ;
30511  uint8_t byte_count ;
30512  bool attached ;
30513  bool tick ;
30514  } USB_DATA ;
30515 
30516 extern USB_DATA
30517  USB ;
30518 /**************************************************************************************/
30519 /**************************************************************************************/
30520 /* Section: Local Functions */
30521 /**************************************************************************************/
30522 /**************************************************************************************/
30523 /*!*************************************************************************************
30524  Function:
30525  static void usb_watchdog(void)
30526  Summary:
30527  This function initializes the wire-line communication power supply parameters.
30528  Description:
30529  This function initializes the wire-line communication power supply parameters.
30530  Initial limits, flags and constants are set here.
30531 
30532  Precondition:
30533  None.
30534  Parameters:
30535  None.
30536  Returns
30537  None.
30538 
30539  Remarks
30540  None.
30541 
30542  Example:
30543  usb_watchdog()
30544  */
30545 
30546 static void
30547  usb_watchdog ( void ) ;
30548 /**************************************************************************************/
30549 /**************************************************************************************/
30550 /* State Machine Functions */
30551 /**************************************************************************************/
30552 /**************************************************************************************/
30553 /*!*************************************************************************************
30554  Function:
30555  void USB_Tasks(void)
30556  Summary:
30557  USB_Tasks function
30558  Description:
30559  This routine is the USB Tasks function. It defines the USB's state machine and
30560  core logic. This machine controls the USB operation and sets flags indicating
30561  new values are available.
30562  Precondition:
30563  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
30564  should be called before calling this.
30565  Parameters:
30566  None.
30567  Returns:
30568  None.
30569  Example:
30570  USB_Tasks()
30571 
30572  Remarks:
30573  This routine must be called from the APP_Tasks() routine.
30574  */
30575 
30576 void
30577  USB_Tasks ( void ) ;
30578  /* USB_H */
30579 /***************************************************************************************
30580  End of File
30581  */
30582 
30583 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\USB.h*/
30584 /* CLOSE_FILE Include File */
30585 
30586 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\UART.h */
30587 /**************************************************************************************/
30601 /**************************************************************************************/
30602 #ifndef UART_H /* Guard against multiple inclusion */
30603 #define UART_H
30604 /**************************************************************************************/
30605 /**************************************************************************************/
30606 /* Section: Included Files */
30607 /**************************************************************************************/
30608 /**************************************************************************************/
30609 #include "../system_definitions.h"
30610 /**************************************************************************************/
30611 /**************************************************************************************/
30612 /* Section: Data Types */
30613 /**************************************************************************************/
30614 /**************************************************************************************/
30615 /**************************************************************************************/
30616 /* UART states
30617  Summary:
30618  UART states enumeration
30619  Description:
30620  This enumeration defines the valid UART states. These states
30621  determine the behavior of the UART state machine at various times.
30622 */
30623 
30624 typedef
30625  enum
30626  {
30632  } UART_STATES ;
30633 /**************************************************************************************/
30634 /* UART Data
30635  Summary:
30636  Holds UART data used for the UART tasks.
30637  Description:
30638  Holds UART data used for the UART tasks. The state machine and variables used
30639  to control UART message are stored here.
30640  Remarks:
30641  None
30642  */
30643 
30644 typedef
30645  struct /* This structure collects the variables and states required for these*/
30646  {
30647  /* functions to operate.*/
30651  bool usage ;
30654  uint8_t bytes_received ;
30655  } UART_DATA ;
30656 
30657 extern UART_DATA
30658  UART ;
30659 /**************************************************************************************/
30660 /**************************************************************************************/
30661 /* Section: Local Functions */
30662 /**************************************************************************************/
30663 /**************************************************************************************/
30664 /*!*************************************************************************************
30665  Function:
30666  static void ReadUART(void)
30667  Summary:
30668  This function reads a byte from the UART when data is received from the host.
30669  Description:
30670  This function reads a byte from the UART when data is received from the host. It
30671  puts the received byte into the RxFifo for later use.
30672 
30673  Precondition:
30674  None.
30675  Parameters:
30676  None.
30677  Returns
30678  None.
30679 
30680  Remarks
30681  None.
30682 
30683  Example:
30684  ReadUART()
30685  */
30686 
30687 static void
30688  ReadUART ( void ) ;
30689 /*!*************************************************************************************
30690  Function:
30691  static void WriteUART(void)
30692  Summary:
30693  This function transfers a byte to the host.
30694  Description:
30695  This function transfers a byte to the host. A byte is transferred from the
30696  TxFifo to the UART for transmission to the host. The baud rate is 115200,N-8-1.
30697  Once the required number of bytes are transferred, a flag is set to notify the
30698  UART_Tasks machine to look for a another transmission from the host.
30699 
30700  Precondition:
30701  None.
30702  Parameters:
30703  None.
30704  Returns
30705  None.
30706 
30707  Remarks
30708  None.
30709 
30710  Example:
30711  WriteUART()
30712  */
30713 
30714 static void
30715  WriteUART ( void ) ;
30716 /**************************************************************************************/
30717 /**************************************************************************************/
30718 /* State Machine Functions */
30719 /**************************************************************************************/
30720 /**************************************************************************************/
30721 /*!*************************************************************************************
30722  Function:
30723  *
30724  void UART_Tasks(void)
30725  Summary:
30726  UART_Tasks function
30727  Description:
30728  This routine is the UART_Tasks function. It defines the UART_Tasks state
30729  machine and core logic. This machine is used to send and receive data from the
30730  host.
30731  Precondition:
30732  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
30733  should be called before calling this.
30734  Parameters:
30735  None.
30736  Returns:
30737  None.
30738  Remarks:
30739  This routine must be called from the APP_Tasks() routine.
30740  Example:
30741  UART_Tasks()
30742  */
30743 
30744 void
30745  UART_Tasks ( void ) ;
30746  /* UART_H */
30747 /***************************************************************************************
30748  End of File
30749  */
30750 
30751 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\UART.h*/
30752 /* CLOSE_FILE Include File */
30753 
30754 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\cf.h */
30755 /**************************************************************************************/
30769 /**************************************************************************************/
30770 #ifndef CF_H /* Guard against multiple inclusion.*/
30771 #define CF_H
30772 /**************************************************************************************/
30773 /**************************************************************************************/
30774 /* Section: Included Files */
30775 /**************************************************************************************/
30776 /**************************************************************************************/
30777 #include "../system_config.h"
30778 #include "../system_definitions.h"
30779 #include <stdbool.h>
30780 /**************************************************************************************/
30781 /**************************************************************************************/
30782 /* Section: Defines */
30783 /**************************************************************************************/
30784 /**************************************************************************************/
30785 #define I_ARRAY_SIZE 50U
30786 
30787 typedef
30788 float
30789  float32_t ;
30790 /**************************************************************************************/
30791 /**************************************************************************************/
30792 /* Section: Data Types */
30793 /**************************************************************************************/
30794 /**************************************************************************************/
30795 /**************************************************************************************/
30796 /* CF_STATES
30797  Summary:
30798  CF_STATES enumeration
30799  Description:
30800  This enumeration defines the valid CF states. These states
30801  determine the behavior of the CF state machine at various times.
30802 */
30803 
30804 typedef
30805  enum
30806  {
30812  } CF_STATES ;
30813 /**************************************************************************************/
30814 /* CF_DATA
30815  Summary:
30816  Holds CFS_DATA used for the CF tasks.
30817  Description:
30818  Holds CF_DATA used for the CF tasks. The state machine and variables
30819  used to control CF functions are stored here.
30820  Remarks:
30821  None
30822  */
30823 
30824 typedef
30825  struct
30826  {
30827  CF_STATES state ;
30828  DRV_HANDLE drvICHandle ;
30829  uint16_t voltage ;
30830  uint16_t voltage_limit ;
30831  uint16_t upper_voltage_limit ;
30832  uint16_t volt_count ;
30833  uint16_t current ;
30834  uint16_t max_current ;
30835  uint16_t current_limit ;
30836  uint16_t upper_current_limit ;
30837  uint8_t over_current_count ;
30838  uint8_t array_count ;
30839  int16_t i_array [ 50U ] ;
30840  int16_t i_sum ;
30841  bool new_current_values_flag ;
30842  bool new_voltage_values_flag ;
30843  bool overcurrent_flag ;
30844  bool overvoltage_flag ;
30845  uint16_t sensor_offset ;
30846  uint16_t sensor_constant ;
30847  bool sensor_offset_tick ;
30848  uint16_t v_array [ 50 ] ;
30849  uint32_t v_sum ;
30850  float32_t v_avg ;
30851  bool tick ;
30852  uint8_t no_count ;
30853  bool array_full ;
30854  uint8_t overvoltage_count ;
30855  } CF_DATA ;
30856 
30857 extern CF_DATA
30858  CF ;
30859 /**************************************************************************************/
30860 /**************************************************************************************/
30861 /* State Machine Functions */
30862 /**************************************************************************************/
30863 /**************************************************************************************/
30864 /*!*************************************************************************************
30865  Function:
30866  *
30867  void CF_Tasks(void)
30868  Summary:
30869  CF_Tasks function
30870  Description:
30871  This routine is the CF_Tasks function. It defines the CF_Tasks state
30872  machine and core logic. This machine is used to monitor the wire-line shooting
30873  power supply (CF) voltage and current and will set flags when those limits
30874  are exceeded. Those flags are monitored by the HV_PS machine and will turn the
30875  supply off if either of those flags are set.
30876  Precondition:
30877  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
30878  should be called before calling this.
30879  Parameters:
30880  None.
30881  Returns:
30882  None.
30883  Remarks:
30884  This routine must be called from the APP_Tasks() routine.
30885  Example:
30886  CF_Tasks()
30887  */
30888 
30889 void
30890  CF_Tasks ( void ) ;
30891  /* CF_H */
30892 /***************************************************************************************
30893  End of File
30894  */
30895 
30896 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\cf.h*/
30897 /* CLOSE_FILE Include File */
30898 
30899 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_okay.h */
30900 /* ************************************************************************** */
30913 /**************************************************************************************/
30914 #ifndef SYSTEM_OKAY_H /* Guard against multiple inclusion */
30915 #define SYSTEM_OKAY_H
30916 /**************************************************************************************/
30917 /**************************************************************************************/
30918 /* Section: Included Files */
30919 /**************************************************************************************/
30920 /**************************************************************************************/
30921 #include <stdint.h>
30922 #include <stdbool.h>
30923 /**************************************************************************************/
30924 /**************************************************************************************/
30925 /* Section: Structure Data and Local Variables */
30926 /**************************************************************************************/
30927 /**************************************************************************************/
30928 /* SYSTEM_OKAY Data
30929  Summary:
30930  These structures hold required data.
30931  Description:
30932  This enumeration defines the valid SYSTEM_OKAY states. These states
30933  determine the behavior of the SYSTEM_OKAY state machine at various times.
30934 
30935 */
30936 
30937 typedef
30938  enum
30939  {
30944  } SYSTEM_OKAY_STATES ;
30945  /**************************************************************************************/
30946 
30947 typedef
30948  struct /* This structure collects the variables and states required for these*/
30949  {
30950  /* functions to operate.*/
30952  bool tick ;
30953  } SYSTEM_OKAY_DATA ;
30954 
30955 extern SYSTEM_OKAY_DATA
30956  SYSTEM_OKAY ;
30957 /**************************************************************************************/
30958 /**************************************************************************************/
30959 /* Section: State Machine Functions */
30960 /**************************************************************************************/
30961 /**************************************************************************************/
30962 /*!*************************************************************************************
30963  Function:
30964  void SYSTEM_OKAY_Tasks(void)
30965  Summary:
30966  SYSTEM_OKAY tasks function
30967  Description:
30968  This routine is the SYSTEM_OKAY tasks function. It defines the SYSTEM_OKAY's
30969  state machine and core logic. This code should execute only if the fuse does not
30970  blow when the SYSTEM_OKAY timer expires. This code will turn off all power
30971  supplies so the tool can be safely retrieved.
30972  Precondition:
30973  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
30974  should be called before calling this.
30975  Parameters:
30976  None.
30977  Returns:
30978  None.
30979 
30980  Remarks:
30981  This routine must be called from APP_Tasks() routine.
30982  Example:
30983  SYSTEM_OKAY_Tasks()
30984  */
30985 
30986 void
30987  SYSTEM_OKAY_Tasks ( void ) ;
30988  /* Provide C++ Compatibility */
30989  /* SYSTEM_OKAY_H */
30990 /***************************************************************************************
30991  End of File
30992  */
30993 
30994 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_okay.h*/
30995 /* CLOSE_FILE Include File */
30996 
30997 /**************************************************************************************/
30998 /**************************************************************************************/
30999 /* Section: Structure Data and Local Variables */
31000 /**************************************************************************************/
31001 /**************************************************************************************/
31002 /**************************************************************************************/
31003 /* appData Data
31004  Summary:
31005  This structure holds the required variables to perform the APP tasks.
31006  Description:
31007  This structures holds the required variables to perform the APP tasks.
31008  These are here to link these structures for use by the local functions.
31009 
31010  Remarks:
31011  These are defined in app.h
31012 */
31013 
31014 APP_DATA
31016 /**************************************************************************************/
31017 /**************************************************************************************/
31018 /* Section: Application Initialization and State Machine Functions */
31019 /**************************************************************************************/
31020 /**************************************************************************************/
31021 /***************************************************************************************
31022  Function:
31023  void APP_Initialize ( void )
31024 
31025  Summary:
31026  Shooting panel application initialization routine.
31027  Remarks:
31028  See prototype in app.h.
31029 */
31030 
31031 void
31033  {
31034  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
31035  ADC.state = ADC_STATE_INIT ;/* Initialize the ADC task machine.*/
31036  SWITCH.state = SWITCH_STATE_INIT ;/* Initialize the SWITCH task machine.*/
31037  COMM.state = COMM_STATE_INIT ;/* Initialize the COMM task machine.*/
31038  CMD.state = COMMAND_STATE_INIT ;/* Initialize the CMD task machine.*/
31039  FSK.state = FSK_STATE_INIT ;/* Initialize the FSK task machine.*/
31040  MAN.state = MAN_STATE_INIT ;/* Initialize the MAN task machine.*/
31041  WL_CPS.state = WL_CPS_STATE_INIT ;/* Initialize the WL_CPS task machine.*/
31042  HV_PS.state = HVPS_STATE_INIT ;/* Initialize the HV_PS task machine.*/
31043  WL_SPS.state = WL_SPS_STATE_INIT ;/* Initialize the WL_SPS task machine.*/
31044  TIMER.state = TIMER_STATE_INIT ;/* Initialize the TIMER state machine.*/
31045  USB.state = USB_STATE_INIT ;/* Initialize the USB state machine.*/
31046  UART.state = UART_STATE_INIT ;/* Initialize the UART state machine.*/
31047  Init_Fifo () ;/* Initialize the FIFO. There is no state machine.*/
31048  CF.state = CF_STATE_INIT ;/* Initialize the CF state machine.*/
31050  /* Initialize the SYSTEM_OKAY state machine.*/
31051  /* LDRA_INSPECTED 105 D
31052 */
31053  APP.RevNumber = 100 ;/* The firmware revision number. Divide by 100 on host side.*/
31054  ((int)(bitmapstruct.element1 |= (1 << 29))); /* 30 */
31055  app_64zqendz ( 62 ) ; /* 30 */
31056  }
31057 /***************************************************************************************
31058  Function:
31059  void APP_Tasks(void)
31060  Summary:
31061  This routine is the APP_Tasks function. This is where the application
31062  manipulates the various state machines.
31063  Remarks:
31064  Refer to the app.h interface header for function usage details.
31065  */
31066 
31067 void
31068  APP_Tasks ( void )
31069  {
31070  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 30))); /* 37 */
31071  ADC_Tasks () ;/* ADC tasks.*/
31072  SWITCH_Tasks () ;/* Front panel switch and relay control tasks.*/
31073  COMM_Tasks () ;/* Host communication tasks.*/
31074  COMMAND_Tasks () ;/* Command tasks.*/
31075  FSK_Tasks () ;/* FSK tasks to send messages to a PerfSwitch.*/
31076  MAN_Tasks () ;/* Manchester tasks to process a message from a PerfSwitch.*/
31077  WL_CPS_Tasks () ;/* Wire-line communication power supply tasks.*/
31078  WL_SPS_Tasks () ;/* Wire-line shooting power supply monitor tasks.*/
31079  HVPS_Tasks () ;/* High voltage power supply (WL_SPS) control tasks.*/
31080  TIMER_Tasks () ;/* Timer Tasks to control various functions.*/
31081  USB_Tasks () ;/* USB Tasks to control USB communications.*/
31082  UART_Tasks () ;/* UART Tasks to control UART communications.*/
31083  CF_Tasks () ;/* CF tasks to monitor wire line current in ARM_CF.*/
31084  SYSTEM_OKAY_Tasks () ;/* Tasks to verify health of the controller.*/
31085  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 30 */
31086  app_64zqendz ( 64 ) ; /* 30 */
31087  }
31088 /***************************************************************************************
31089  End of File
31090  */
31091 #define qqqbranches 64
31092 #define QQQMAXMCDCSIZE 2
31093 /********************** LDRA_PORT INSTRUMENTATION **********************/
31094 
31095 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
31096 #define ldra_sscanf
31097  /* put in undefs to protect our parameter names from macros */
31098 #undef f
31099 #undef i
31100 #undef j
31101 #undef k
31102 #undef s
31103 #undef l
31104 #undef ii
31105 #undef some
31106 #undef none
31107 #undef from
31108 #undef a
31109 #undef b
31110 #undef iz
31111 #undef jz
31112 #undef qqnull_params
31113 #define qqnull_params void
31114  /* Conventional Instrumentation */
31115 #define qqzzidfield 1
31116  /* single file or fileid */
31117  /* these have an extra field for the fileid */
31118  static char qqqqone[] = "%6d\n"; /* single point */
31119  /* uncompressed data structures */
31120  /* uncompressed bitmap */
31121 #define QQQFIXEDSIZE
31122  static int qqqlast = 0;
31123  extern int qqupload_registered;
31124  extern int app_64zqqzqz(qqnull_params);
31125  extern int app_64zqqzqz1(qqnull_params);
31126  /* ----------------------------------------------------------------------* 200 *
31127  * Procedures
31128  * -----------------------------------------------------------------------------
31129  */
31130  /* ----------- zscanf ---------------------------------------------------* 201 *
31131  * Returns an integer extracted from a string
31132  * -----------------------------------------------------------------------------
31133  */
31134  static int app_64zscanf(char * qqscan_str)
31135  {
31136  int qqvalue;
31137  int qqisign;
31138  char * qqcptr;
31139  qqvalue = 0;
31140  qqisign = 1;
31141  qqcptr = qqscan_str;
31142  /* Skip spaces */
31143  while (qqcptr[0] == ' ')
31144  {
31145  qqcptr++;
31146  }
31147  /* Check for a leading ---
31148  */
31149  if (qqcptr[0] == '-')
31150  {
31151  qqisign = -1;
31152  qqcptr++;
31153  }
31154  /* Extract digits */
31155  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
31156  {
31157  qqvalue = 10 * qqvalue;
31158  qqvalue = qqvalue + (qqcptr[0] - '0');
31159  qqcptr++;
31160  }
31161  qqvalue = qqisign * qqvalue;
31162  return qqvalue;
31163  } /* end of zscanf */
31164  /* ----------------------------------------------------------------------* 210 *
31165  * C System utilities in use:
31166  * fprintf
31167  * fclose
31168  * sscanf
31169  * -----------------------------------------------------------------------------
31170  */
31171  /* ----------------------------------------------------------------------* 213 *
31172  * qqoutput* suite
31173  * Main output routines. These may require modification.
31174  * -----------------------------------------------------------------------------
31175  */
31176  /* ----------------------------------------------------------------------* 214 *
31177  * qqoutput
31178  * This is the principle output routine.
31179  * -----------------------------------------------------------------------------
31180  */
31181  static void qqoutput(FILEPOINT char * s,int i)
31182  /* f - file pointer, s - format string, i - integer for probe value */
31183  {
31184  /* printing to a file */
31185  /* fprintf exists, not threaded */
31186  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
31187  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
31188  ldra_port_write (&ldra_buffer[0]);
31189  } /* end of qqoutput */
31190  /* ----------------------------------------------------------------------* 215 *
31191  * qqoutput0
31192  * -----------------------------------------------------------------------------
31193  */
31194  static void qqoutput0(FILEPOINT char * s)
31195  {
31196  ldra_port_write(s);
31197  } /* end of qqoutput0 */
31198  /* ----------------------------------------------------------------------* 216 *
31199  * qqoutput2
31200  * -----------------------------------------------------------------------------
31201  */
31202  static void qqoutput2(FILEPOINT char * s,int i, int j)
31203  {
31204  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
31205  ldra_port_write (&ldra_buffer[0]);
31206  } /* end of qqoutput2 */
31207  /* ----------------------------------------------------------------------* 217 *
31208  * qqoutput3
31209  * -----------------------------------------------------------------------------
31210  */
31211  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
31212  {
31213  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
31214  ldra_port_write (&ldra_buffer[0]);
31215  } /* end of qqoutput3 */
31216  /* ----------------------------------------------------------------------* 218 *
31217  * qqoutput4
31218  * -----------------------------------------------------------------------------
31219  */
31220  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
31221  {
31222  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
31223  ldra_port_write (&ldra_buffer[0]);
31224  } /* end of qqoutput4 */
31225  /* ----------------------------------------------------------------------* 219 *
31226  * end of qqoutput* suite
31227  * -----------------------------------------------------------------------------
31228  */
31229  /* ----------------------------------------------------------------------* 222 *
31230  * qqqqinitialise
31231  * This procedure initialises the structures for
31232  * compressed execution histories.
31233  * -----------------------------------------------------------------------------
31234  */
31235  static void qqqqinitialise(int ii)
31236  {
31237  unsigned int i;
31238  /* First time through. */
31239  /* bitmap */
31240  /* bitmap separate */
31241  qqqlast = 1; /* stops qqfun() calling initialise again */
31242  /* bitmap */
31243  /* bitmap singlefile */
31244  /* struct singlefile notmainfl */
31245  } /* end of qqqqinitialise */
31246 /* ----------------------------------------------------------------------* 225 *
31247 * qqqbitmapreset
31248 * This procedure resets the structures for
31249 * compressed execution histories.
31250 * -----------------------------------------------------------------------------
31251 */
31252 static void qqqbitmapreset()
31253 {
31254 struct bitmapstruct_t localbitmap = {0};
31255 bitmapstruct = localbitmap;
31256 } /* end of qqqbitmapreset */
31257 #undef QQQTEMP1
31258 #define QQQTEMP1
31259  /* ----------- zqqzqz ---------------------------------------------------* 310 *
31260  * -----------------------------------------------------------------------------
31261  */
31262  /* ----------------------------------------------------------------------* 312 *
31263  * This routine opens the execution history file. It is instrumented at the
31264  * start of the main program if one exists in the file. In general this is
31265  * superceded by app_64zqqzqz1 below.
31266  * -----------------------------------------------------------------------------
31267  */
31269  {
31270  if ( app_64zzopen != 1 )
31271  {
31272 #undef QQQMUSTOPEN
31273  app_64zzopen = 1;
31274  }
31275  return(1);
31276  } /* end of zqqzqz */
31277  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
31278  * -----------------------------------------------------------------------------
31279  */
31280  /* ----------------------------------------------------------------------* 317 *
31281  * This routine also opens the execution history file. It is called
31282  * automatically if a probe fires and the execution history is not already
31283  * opened (app_64zzopen = 0 ).
31284  * Because this always works ( it was intended for files with no main program
31285  * it is now the de facto common way to open the execution history.
31286  * -----------------------------------------------------------------------------
31287  */
31289  {
31290  if ( app_64zzopen != 1 )
31291  {
31292  ldra_port_open(); /* 7 */
31293  qqqqinitialise(0);
31294  app_64zzopen = 1;
31295  }
31296  return(1);
31297  } /* end of zqqzqz1 */
31298  /* ----------- zqendz ---------------------------------------------------* 330 *
31299  * This routine is called on exiting a routine in a
31300  * module. It closes the execution history.
31301  * -----------------------------------------------------------------------------
31302  */
31303 static int app_64zqendz(int qqqi)
31304  {
31305  if (!qqqstructzzopen)
31306  {
31308  qqqstructzzopen = 1;
31309  }
31310  if ( app_64zzopen != 1 )
31311  {
31312  app_64zqqzqz1();
31313  }
31314  /* ----------------------------------------------------------------------* 331 *
31315  * this is the one which puts an integer into
31316  * the execution history file and returns unity.
31317  * The format of each field consists of six columns,
31318  * the number is right justified in this field.
31319  * -----------------------------------------------------------------------------
31320  */
31321  if ( app_64zzopen )
31322  {
31323  /* uncompressed */
31324  /* uncompressed unbuffered */
31325  /* uncompressed unbuffered bitmap */
31326  if ( qqqi > 0 )
31327  {
31328  }
31329  else
31330  {
31331  }
31332  }
31333  qqqlast = 0;
31334  return(1);
31335  } /* end of zqendz */
31336  /* ----------------------------------------------------------------------* 335 *
31337  * Output structure - qqbmsoutput
31338  * -----------------------------------------------------------------------------
31339  */
31340  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
31341  {
31342  static int branches_printed = 0;
31343  int b, last = 0;
31344  for(b=0;b<qqqqbmselwidth/8;b++)
31345  {
31346  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
31347  ldra_port_write (&ldra_buffer[0]);
31348  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
31349  ldra_port_write (&ldra_buffer[0]);
31350  last += 8;
31351  branches_printed += 8;
31352  if (branches_printed >= qqqbranches)
31353  {
31354  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
31355  break;
31356  }
31357  }
31358  }
31359  /* ----------------------------------------------------------------------* 336 *
31360  * qqqupload
31361  * This routine loops through the stored bitmap and
31362  * outputs it. It then uploads the stored mcdc.
31363  * -----------------------------------------------------------------------------
31364  */
31365  static void qqqupload(qqnull_params)
31366  {
31367  int i;
31368  /* uncompressed bitmap (!singlefile or mainfl) separate */
31369  {
31370  app_64zqqzqz1();
31371 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
31372 #define LASTELEMENT
31373 #include "app_64zbelem.def"
31374 #undef LASTELEMENT
31375 #undef ELEMENT
31376  }
31377  /* bitmap separate */
31378  qqqlast = 1; /* stops qqfun() calling initialise again */
31379  } /* end of qqqupload */
31380  /* ----------- zqzqzq ---------------------------------------------------* 342 *
31381  * -----------------------------------------------------------------------------
31382  */
31383  /* ----------------------------------------------------------------------* 344 *
31384  * This routine should be called before the program
31385  * terminates. It closes the execution history
31386  * -----------------------------------------------------------------------------
31387  */
31388  static int app_64zqzqzq(int qqqi)
31389  {
31390  if ( app_64zzopen != 1 )
31391  {
31392  app_64zqqzqz1();
31393  }
31394  /* not compressed */
31395  /* do nothing for bitmap*/
31396  /* upload the history */
31397  /* bitmap */
31398  /* uncompressed bitmap */
31399  app_64zqendz(qqqi);
31400  /* qqqupload closes the execution history file */
31401  return(1);
31402  } /* end of zqzqzq */
31403  /* the following routines should be left alone */
31404 /* END OF TESTBED INSTRUMENTATION */
31405 
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
static void qqoutput(FILEPOINT char *s, int i)
Definition: inszt_app.c:31181
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
DRV_USART_BUFFER_EVENT
Definition: inszt_app.c:14987
S3_COMMAND
Definition: inszt_app.c:27690
#define DRV_IC_Open(drvIndex, intent)
Definition: inszt_app.c:1308
void DRV_TMR1_CounterValueSet(uint32_t value)
uint8_t byte_count
Definition: inszt_app.c:30511
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
static void DRV_TMR4_Tasks(void)
Definition: inszt_app.c:4116
static int app_64zqendz(int qqqi)
Definition: inszt_app.c:31303
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void HVPS_Tasks(void)
Definition: hvps.c:117
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
static float32_t Calc_Fsk_Scaling(void)
uint16_t max_current
Definition: inszt_app.c:28642
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
void DRV_TMR2_CounterValueSet(uint32_t value)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
void Calc_Auto_Bias(void)
Definition: inszt_man.c:30558
static void Init_WL_CPS(void)
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
void SYS_DEBUG_Message(const char *message)
ADC_STATES state
Definition: adc.h:81
bool new_current_flag
Definition: inszt_app.c:28649
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
uint8_t Fifo_Put(TFifo *ptrFifo, uint8_t Data)
Definition: fifo.c:117
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void DRV_TMR2_Initialize(void)
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
COMMAND_STATES
Definition: commands.h:62
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
uint8_t Fifo_Get(TFifo *ptrFifo)
Definition: fifo.c:160
static int tbrun_mode
Definition: inszt_app.c:101
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
uint8_t DRV_USART0_ReadByte(void)
void PLIB_SPI_Enable(SPI_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_app.c:15157
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
uint8_t array_count
Definition: inszt_app.c:28462
void Init_Fifo(void)
Definition: fifo.c:100
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
static void store_switches(void)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
COMMAND_STATES
Definition: inszt_app.c:30083
MSG_DATA MSG
Definition: fsk.c:72
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool Valid_Command(uchar8_t msg)
Definition: commands.c:1111
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
static const uint8_t Xmit11[312]
Definition: inszt_app.c:29034
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void USB_Tasks(void)
Definition: inszt_USB.c:28611
static void WriteUART(void)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
bool debounce_tick
Definition: inszt_app.c:27675
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
float32_t hi_volts
Definition: inszt_app.c:29454
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
Definition: inszt_app.c:1819
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
#define app_64zqqzqz1
Definition: inszt_app.c:83
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
float float32_t
Definition: cf.h:50
uint8_t read_try
Definition: inszt_app.c:27676
uint8_t array_sum_count
Definition: inszt_app.c:28461
static void qqqbitmapreset(qqnull_params)
void DRV_TMR3_CounterValueSet(uint32_t value)
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
void DRV_ADC0_Close(void)
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_app.c:26138
UART_STATES state
Definition: inszt_app.c:30648
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void DRV_TMR_Close(DRV_HANDLE handle)
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
uint32_t DRV_TMR4_CounterValueGet(void)
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
uint8_t timer1_1000mS_count
Definition: inszt_app.c:30388
bool SYS_DMA_IsBusy(void)
void DRV_TMR3_StopInIdleEnable(void)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
DRV_USART_ERROR
Definition: inszt_app.c:15317
float32_t slope
Definition: inszt_app.c:29455
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
bool bad_crc
Definition: inszt_app.c:29423
uint8_t overvoltage_count
Definition: inszt_app.c:28656
static void Send_Message_Tasks(void)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
Definition: hvps.h:84
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
static void qqoutput0(FILEPOINT char *s)
Definition: inszt_app.c:31194
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
MAN_RX_STATES Rx_state
Definition: inszt_app.c:29408
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
uint16_t avg_current
Definition: inszt_app.c:28655
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
WL_SPS_STATES
Definition: inszt_app.c:28425
static void ReadUART(void)
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
bool DRV_TMR2_Start(void)
DRV_USART_HANDSHAKE
Definition: inszt_app.c:15132
bool timer1_100uS_tick
Definition: inszt_app.c:30379
#define qqqbranches
Definition: inszt_app.c:31091
bool write_complete
Definition: inszt_app.c:30650
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
void Set_HVPS_Ramp_Rate(uint16_t value)
Definition: hvps.c:89
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint16_t volt_count
Definition: inszt_app.c:28455
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
uint8_t upper_current_limit
Definition: inszt_app.c:28644
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
float32_t hi_current
Definition: inszt_app.c:29451
SYS_STATUS DRV_USART0_Status(void)
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
void DRV_IC0_Start(void)
void Adjust_WL_CPS_Voltage(uint8_t target)
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
CF_STATES
Definition: inszt_app.c:30804
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
void WL_SPS_Tasks(void)
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
TMultiValue MESSAGE
Definition: fsk.c:70
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
ADC_DATA ADC
Definition: adc.c:53
Definition: fifo.h:59
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
void PLIB_USART_Enable(USART_MODULE_ID index)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
uint16_t voltage_limit
Definition: inszt_app.c:28453
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
static SYS_STATUS DRV_TMR2_Status(void)
Definition: inszt_app.c:3824
static int zzfileid
Definition: inszt_app.c:54
COMM_STATES
Definition: commmodule.h:55
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
void DRV_TMR0_StopInIdleDisable(void)
S7_COMMAND
Definition: inszt_app.c:27723
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_ERROR_LEVEL
Definition: inszt_app.c:17439
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
bool DRV_TMR1_Start(void)
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
static void read_switches(void)
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
S7_COMMAND S7_state
Definition: inszt_app.c:27776
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
uint8_t bytes_received
Definition: inszt_app.c:30654
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
static void DRV_TMR4_DeInitialize(void)
Definition: inszt_app.c:4035
DRV_TMR_CLK_SOURCES
Definition: inszt_app.c:1585
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
static const uint8_t Xmit00[168]
Definition: inszt_app.c:29048
void SWITCH_Tasks(void)
void DRV_TMR4_Stop(void)
uint8_t DRV_PMP0_Read(void)
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
bool overcurrent_flag
Definition: inszt_app.c:28468
MAN_PROCESS_STATES
Definition: inszt_app.c:29386
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
MSG_STATES
Definition: inszt_app.c:28963
void DRV_IC0_Initialize(void)
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
COMM_DATA COMM
Definition: commmodule.c:58
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE bufferHandle
Definition: inszt_app.c:28636
float32_t lo_current
Definition: inszt_app.c:29452
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
static int qqqisinitialised
Definition: inszt_main.c:152
COMMAND_DATA CMD
Definition: commands.c:196
DRV_USART_TRANSFER_STATUS
Definition: inszt_app.c:15380
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
PREAMBLE_STATES
Definition: inszt_app.c:29003
bool DepthStatus
Definition: commands.c:204
int16_t i_sum
Definition: inszt_app.c:28465
bool DRV_USART0_TransmitBufferIsFull(void)
bool spi_write_complete_flag
Definition: inszt_app.c:28650
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_ADC1_Open(void)
void DRV_PMP0_ModeConfig(void)
static char qqqqone[]
Definition: inszt_app.c:31118
static SYS_STATUS DRV_TMR0_Status(void)
Definition: inszt_app.c:3604
WL_SPS_STATES state
Definition: inszt_app.c:28450
uint32_t DRV_TMR2_CounterValueGet(void)
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
uint8_t avg_count
Definition: inszt_app.c:28652
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
Definition: inszt_app.c:3736
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void DRV_TMR_Stop(DRV_HANDLE handle)
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
uint8_t over_current_count
Definition: inszt_app.c:28460
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
MAN_DATA MAN
Definition: inszt_man.c:29573
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
WL_SPS_DATA WL_SPS
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
static void Execute_System(void)
void PLIB_USART_Disable(USART_MODULE_ID index)
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
bool timer1_1mS_tick
Definition: inszt_app.c:30380
static bool Check_Manchester(void)
void DRV_TMR1_PeriodValueSet(uint32_t value)
SWITCH_COMMAND SW_COM
void MAN_Tasks(void)
Definition: inszt_man.c:29645
HVPS_DATA HV_PS
Definition: hvps.c:56
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
SYS_DMA_CHANNEL_CHAIN_PRIO
Definition: inszt_app.c:13186
void DRV_TMR3_Initialize(void)
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
uint32_t v_sum
Definition: inszt_app.c:28475
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
void DRV_ADC_Stop(void)
uint32_t DRV_TMR0_CounterValueGet(void)
MAN_BIAS_DATA MAN_BIAS
Definition: inszt_man.c:29570
void DRV_TMR2_CounterClear(void)
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void Test_Manchester(void)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
void APP_Initialize(void)
Definition: inszt_app.c:31032
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
Definition: fsk.h:123
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
static void Send_Mark(void)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
S5_COMMAND S5_state
Definition: inszt_app.c:27778
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
static void MAN_PROCESS_Tasks(void)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void FSK_Tasks(void)
Definition: fsk.c:104
bool DRV_TMR_Start(DRV_HANDLE handle)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
SYSTEM_OBJECTS sysObj
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
WL_CPS_STATES state
Definition: inszt_app.c:28634
void DRV_ADC_Start(void)
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
DRV_IO_INTENT
Definition: inszt_app.c:866
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
uint8_t current_limit
Definition: inszt_app.c:28643
void CF_Tasks(void)
Definition: cf.c:80
DRV_USART_CLIENT_STATUS
Definition: inszt_app.c:15355
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
WL_CPS_STATES
Definition: inszt_app.c:28620
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
uint16_t max_current
Definition: inszt_app.c:28457
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
FSK_STATES
Definition: inszt_app.c:28879
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t PORTS_DATA_TYPE
Definition: inszt_app.c:18423
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
bool epDataReadPending
Definition: inszt_app.c:30505
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
uint32_t DRV_TMR2_CounterFrequencyGet(void)
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
bool spi_write_complete_flag
Definition: inszt_app.c:29418
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
uint32_t DRV_TMR3_PeriodValueGet(void)
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
uint32_t baudRate
Definition: inszt_adc.c:26572
uint8_t crc
Definition: inszt_app.c:29426
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_app.c:13249
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
void DRV_IC0_Stop(void)
uint16_t PORTS_DATA_MASK
Definition: inszt_app.c:18410
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_IO_BUFFER_TYPES
Definition: inszt_app.c:967
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
CF_DATA CF
Definition: cf.c:59
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void DRV_TMR3_StopInIdleDisable(void)
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static SYS_STATUS DRV_TMR4_Status(void)
Definition: inszt_app.c:4044
DRV_ADC_MODULE_ID
Definition: inszt_app.c:1400
unsigned char uchar8_t
Definition: commands.h:52
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
uint16_t current_limit
Definition: inszt_app.c:28458
USB_ENDPOINT_ADDRESS endpointTx
Definition: inszt_app.c:30508
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
void DRV_TMR2_PeriodValueSet(uint32_t value)
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
static void DRV_TMR0_Close(void)
Definition: inszt_app.c:3636
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
static int qqqlast
Definition: inszt_app.c:31122
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
Definition: inszt_app.c:31220
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
CF_STATES state
Definition: cf.h:93
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
int qqupload_registered
Definition: inszt_main.c:6760
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
void DRV_SPI_Close(DRV_HANDLE handle)
uint8_t no_count
Definition: inszt_app.c:28478
void DRV_TMR1_StopInIdleEnable(void)
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
bool debounce_flag
Definition: inszt_app.c:27674
void Set_WL_SPS_CurrentLimit(uint16_t value)
USB_STATES state
Definition: inszt_app.c:30499
float32_t offset
Definition: inszt_app.c:29456
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
static void DRV_TMR2_DeInitialize(void)
Definition: inszt_app.c:3815
void qqqtotalreset(void)
Definition: inszt_main.c:7067
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
static void qqqupload(qqnull_params)
Definition: inszt_app.c:31365
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
float32_t lo_volts
Definition: inszt_app.c:29453
void SYS_DEBUG_Print(const char *format,...)
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
USB_DATA USB
Definition: inszt_USB.c:28398
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
void Generate_Sine_Wave_Data(float32_t NoOfTicks)
Definition: fsk.c:501
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
APP_DATA APP
Definition: inszt_app.c:31015
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
DRV_TMR_OPERATION_MODE
Definition: inszt_app.c:1739
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
void WL_CPS_Tasks(void)
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void Execute_Protocol_A(void)
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
void DRV_TMR1_StopInIdleDisable(void)
CF_STATES
Definition: cf.h:68
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
uint16_t DRV_IC0_Capture16BitDataRead(void)
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR_CounterClear(DRV_HANDLE handle)
DRV_CLIENT_STATUS
Definition: inszt_app.c:910
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
void DRV_TMR3_CounterClear(void)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
SYSTEM_OKAY_DATA SYSTEM_OKAY
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
DRV_HANDLE spi_cont_pot
Definition: inszt_app.c:28635
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_app.c:21755
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
SYS_DMA_ERROR
Definition: inszt_app.c:13382
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
USB_DEVICE_TRANSFER_HANDLE writeTranferHandle
Definition: inszt_app.c:30506
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_HANDLE handleUSART0
Definition: inszt_app.c:30649
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
void DRV_TMR0_Stop(void)
void APP_Tasks(void)
Definition: inszt_app.c:31068
DRV_IO_INTENT
Definition: inszt_adc.c:975
static void DRV_TMR2_Tasks(void)
Definition: inszt_app.c:3896
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_SPI_CLOCK_MODE
Definition: inszt_app.c:26190
uint32_t DRV_TMR3_CounterValueGet(void)
bool array_full
Definition: inszt_app.c:28479
USB_DEVICE_HANDLE usbDevHandle
Definition: inszt_app.c:30500
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
void DRV_TMR4_CounterValueSet(uint32_t value)
static void DRV_TMR1_Close(void)
Definition: inszt_app.c:3746
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
Definition: fsk.h:170
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
void DRV_TMR2_Stop(void)
#define app_64zzopen
Definition: inszt_app.c:81
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
void MAN_RX_Tasks(void)
Definition: inszt_man.c:29829
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
SYS_DMA_DATA_WIDTH
Definition: inszt_app.c:13413
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
bool DRV_SPIn_ReceiverBufferIsFull(void)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_app.c:21779
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t Fifo_Length(TFifo *ptrFifo)
Definition: fifo.c:202
uint32_t DRV_TMR0_PeriodValueGet(void)
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
static void process_switches(void)
void DRV_TMR0_StopInIdleEnable(void)
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
uint8_t timer1_1mS_count
Definition: inszt_app.c:30385
static SYS_STATUS DRV_TMR3_Status(void)
Definition: inszt_app.c:3934
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
uint16_t rate_time
Definition: inszt_app.c:28275
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
float32_t volt_constant
Definition: inszt_app.c:28646
void ADC_Tasks(void)
Definition: adc.c:75
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
MAN_STATES
Definition: inszt_app.c:29350
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
Definition: fsk.h:217
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
void DRV_TMR0_Initialize(void)
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
static SYS_STATUS DRV_TMR1_Status(void)
Definition: inszt_app.c:3714
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
DRV_HANDLE spi_bias_fsk
Definition: inszt_app.c:29445
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
uint8_t index
Definition: inszt_app.c:29457
static void usb_watchdog(void)
DRV_SPI_BUFFER_HANDLE bufferHandle2
Definition: inszt_app.c:29447
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_app.c:26258
bool tick
Definition: inszt_app.c:30513
static void execute_switches(void)
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
void DRV_ADC_Initialize(void)
static void DRV_TMR1_Open(void)
Definition: inszt_app.c:3725
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
void DRV_USART0_WriteByte(const uint8_t byte)
bool process_complete_flag
Definition: inszt_app.c:29417
void DRV_USART0_Deinitialize(void)
S3_COMMAND S3_state
Definition: inszt_app.c:27774
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
uint16_t dac_b_setting
Definition: inszt_app.c:29450
Definition: fsk.h:78
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
bool usage
Definition: inszt_app.c:30651
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
void DRV_TMR0_PeriodValueSet(uint32_t value)
static void DRV_TMR2_Close(void)
Definition: inszt_app.c:3856
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
ADC_STATES
Definition: adc.h:55
void DRV_IC_Stop(DRV_HANDLE handle)
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
uint16_t current
Definition: inszt_app.c:28641
uint8_t trynumber
Definition: inszt_app.c:29416
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
static void Send_Space(void)
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
uint32_t DRV_TMR2_PeriodValueGet(void)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
uint32_t DRV_TMR4_CounterFrequencyGet(void)
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
USB_DEVICE_TRANSFER_HANDLE readTranferHandle
Definition: inszt_app.c:30507
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
uintptr_t DRV_HANDLE
Definition: inszt_app.c:999
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
SYS_DMA_SIDL
Definition: inszt_app.c:13166
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
static void DRV_TMR1_Tasks(void)
Definition: inszt_app.c:3786
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_app.c:21794
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
Definition: inszt_app.c:26406
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_app.c:13207
uint32_t DRV_IC0_Capture32BitDataRead(void)
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
static void DRV_TMR2_Open(void)
Definition: inszt_app.c:3835
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
#define DRV_IC_Close(handle)
Definition: inszt_app.c:1309
uint16_t v_array_count
Definition: inszt_app.c:28474
uint8_t RevNumber
Definition: app.h:61
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
void DRV_TMR0_CounterValueSet(uint32_t value)
void DRV_TMR2_StopInIdleDisable(void)
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
static void Package_Manchester(void)
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
float32_t v_avg
Definition: inszt_app.c:28476
bool spi_sent_flag
Definition: inszt_app.c:29419
bool DRV_SPIn_TransmitterBufferIsFull(void)
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
uint16_t upper_current_limit
Definition: inszt_app.c:28459
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void SYS_DMA_Resume(void)
void DRV_TMR1_Initialize(void)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
Definition: inszt_app.c:15119
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
SWITCH_STATES state
Definition: inszt_app.c:27660
void DRV_USART0_Close(void)
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
static int app_64zscanf(char *qqscan_str)
Definition: inszt_app.c:31134
bool epDataWritePending
Definition: inszt_app.c:30504
S1_COMMAND
Definition: inszt_app.c:27739
DRV_USART_ERROR
Definition: inszt_adc.c:15426
uint16_t upper_voltage_limit
Definition: inszt_app.c:28454
MAN_STATES state
Definition: inszt_app.c:29407
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
HVPS_STATES
Definition: hvps.h:54
bool tick
Definition: inszt_app.c:29422
void(* ldra_void_function)()
Definition: inszt_app.c:119
uint8_t timer1_10mS_count
Definition: inszt_app.c:30386
USB_SPEED speed
Definition: inszt_app.c:30503
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
uint8_t queueSize
Definition: inszt_adc.c:26592
static struct bitmapstruct_t bitmapstruct
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
uint32_t DRV_TMR1_CounterFrequencyGet(void)
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
SWITCH_DATA SWITCH
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
int qqqshell_upload
Definition: inszt_main.c:150
uint32_t DRV_TMR0_CounterFrequencyGet(void)
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
COMM_STATES
Definition: inszt_app.c:28086
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
TFifo TX_FIFO
Definition: fifo.c:48
void DRV_USART0_TasksReceive(void)
void DRV_TMR0_CounterClear(void)
unsigned char uchar8_t
Definition: inszt_app.c:30075
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool attached
Definition: inszt_app.c:30512
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void SYSTEM_OKAY_Tasks(void)
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
SYSTEM_OKAY_STATES
Definition: inszt_app.c:30937
uint8_t dump_fire_switch_S7
Definition: inszt_app.c:27664
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
uint32_t DRV_TMR3_CounterFrequencyGet(void)
static void DRV_TMR0_Tasks(void)
Definition: inszt_app.c:3676
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
uint16_t voltage
Definition: inszt_app.c:28452
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
ADC_STATES
Definition: inszt_app.c:27971
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
void DRV_TMR4_CounterClear(void)
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
void COMMAND_Tasks(void)
Definition: commands.c:225
uint8_t avg_count_max
Definition: inszt_app.c:28653
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
uint8_t timer1_100mS_count
Definition: inszt_app.c:30387
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
DOWN_MSG DWNMSG
Definition: fsk.c:69
static void Execute_Auto_Protocol_A(void)
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool timer1_100mS_tick
Definition: inszt_app.c:30382
COMMAND_STATES state
Definition: commands.h:73
void DRV_TMR3_PeriodValueSet(uint32_t value)
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
bool deviceIsConfigured
Definition: inszt_app.c:30501
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_app.c:13272
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_PMP0_Initialize(void)
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
static int qqqstructzzopen
Definition: inszt_app.c:141
void DRV_TMR2_StopInIdleEnable(void)
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
#define qqnull_params
Definition: inszt_app.c:31113
float32_t current_constant
Definition: inszt_app.c:28647
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void DRV_TMR4_Initialize(void)
uint16_t dac_a_setting
Definition: inszt_app.c:29449
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_app.c:13140
struct _DRV_SPI_INIT DRV_SPI_INIT
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
Definition: inszt_app.c:31211
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void Set_Bias(uint8_t value)
Definition: inszt_man.c:30592
static void DRV_TMR1_DeInitialize(void)
Definition: inszt_app.c:3705
DRV_SPI_BUFFER_TYPE
Definition: inszt_app.c:26235
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool DRV_TMR4_Start(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
DRV_SPI_MODE
Definition: inszt_app.c:26312
uint32_t DRV_TMR1_CounterValueGet(void)
static int qqqqbmselwidth
Definition: inszt_app.c:53
uint16_t offset
Definition: inszt_app.c:28463
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
static int QQQfirstmcdc
Definition: inszt_app.c:80
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
bool new_current_values_flag
Definition: inszt_app.c:28466
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
#define FILEPOINT
Definition: inszt_app.c:96
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
bool new_voltage_values_flag
Definition: inszt_app.c:28467
uint16_t settings
Definition: inszt_app.c:27672
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
void TIMER_Tasks(void)
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
PREAMBLE_STATES
Definition: fsk.h:191
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_app.c:14926
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
SYS_DMA_TRANSFER_EVENT
Definition: inszt_app.c:13360
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
static void DRV_TMR3_Open(void)
Definition: inszt_app.c:3945
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
MAN_PROCESS_STATES Process_state
Definition: inszt_app.c:29409
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DRV_HANDLE drvICHandle
Definition: inszt_app.c:28451
void DRV_TMR4_PeriodValueSet(uint32_t value)
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
void SYS_PORTS_Initialize()
void DRV_USART_Close(const DRV_HANDLE handle)
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
uint8_t overvoltage_count
Definition: inszt_app.c:28480
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
WL_CPS_DATA WL_CPS
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
SWITCH_STATES
Definition: inszt_app.c:27636
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
static void Flush_Buffer_Manchester(void)
void SET_WL_SPS_IOffset(uint8_t mode)
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
void DRV_ADC1_Close(void)
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
static void Fifo_Init(TFifo *ptrFifo, uint8_t *ptrBuffer, uint16_t Length)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_app.c:15178
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
uint8_t altSetting
Definition: inszt_app.c:30510
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_app.c:13226
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
UART_STATES
Definition: inszt_app.c:30624
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
USB_ENDPOINT_ADDRESS endpointRx
Definition: inszt_app.c:30509
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
#define QQQnumfil
Definition: inszt_app.c:55
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
void DRV_TMR1_Stop(void)
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DMA_Suspend(void)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
void DRV_ADC_DeInitialize(void)
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool overvoltage_flag
Definition: inszt_app.c:28469
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
bool error
Definition: inszt_app.c:29424
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
uint16_t voltage_limit
Definition: inszt_app.c:28640
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
S4_COMMAND
Definition: inszt_app.c:27708
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
uint32_t SYS_DMA_ChannelCRCGet(void)
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
PRE_DATA PRE_MSG
Definition: fsk.c:73
static void DRV_TMR4_Close(void)
Definition: inszt_app.c:4076
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
TIMER_STATES state
Definition: inszt_app.c:30377
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
HVPS_STATES state
Definition: hvps.h:86
void UART_Tasks(void)
Definition: inszt_UART.c:28419
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
Definition: inszt_app.c:15087
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
void DRV_TMR3_Stop(void)
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE bufferHandle2
Definition: inszt_app.c:28637
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
USB_STATES
Definition: inszt_app.c:30473
bool DRV_USART0_ReceiverBufferIsEmpty(void)
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
Definition: app.h:59
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
static void qqoutput2(FILEPOINT char *s, int i, int j)
Definition: inszt_app.c:31202
Definition: adc.h:78
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
Definition: inszt_app.c:3846
void DRV_PMP0_Write(uint8_t data)
void PLIB_DMA_Disable(DMA_MODULE_ID index)
static unsigned char qqqzzglobflag
Definition: inszt_app.c:171
bool manual_bias_flag
Definition: inszt_app.c:29425
static int app_64zqzqzq(int qqqi)
Definition: inszt_app.c:31388
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool GetDepthStatus(void)
void DRV_USART0_TasksError(void)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
MSG_STATES
Definition: fsk.h:145
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
Definition: cf.h:91
uint8_t count
Definition: inszt_man.c:29594
DRV_USART_INIT_FLAGS
Definition: inszt_app.c:15255
FSK_STATES state
Definition: fsk.h:80
bool spi_sent_flag
Definition: inszt_app.c:28651
void DRV_TMR4_StopInIdleEnable(void)
void COMM_Tasks(void)
Definition: commmodule.c:88
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
static void qqqqinitialise(int ii)
Definition: inszt_app.c:31235
uint16_t sensor_offset
Definition: inszt_app.c:28470
static void Init_FSK(void)
uint8_t hvps_switch_S5
Definition: inszt_app.c:27666
MAN_RX_STATES
Definition: inszt_app.c:29370
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
uint16_t sensor_constant
Definition: inszt_app.c:28471
S1_COMMAND S1_state
Definition: inszt_app.c:27777
uint8_t over_current_count
Definition: inszt_app.c:28645
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
void Set_WL_CPS_CurrentLimit(uint8_t value)
static void Init_Manchester(void)
DRV_USART_OPERATION_MODE
Definition: inszt_app.c:14950
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
Definition: inszt_app.c:3626
DRV_SPI_BUFFER_EVENT
Definition: inszt_app.c:26290
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
DRV_USART_LINE_CONTROL
Definition: inszt_app.c:15206
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
static void DRV_TMR3_Close(void)
Definition: inszt_app.c:3966
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
TIMER_STATES
Definition: inszt_app.c:30355
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
bool DRV_TMR3_Start(void)
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
DRV_TMR_CLIENT_STATUS
Definition: inszt_app.c:1692
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static int app_64zqqzqz(qqnull_params)
Definition: inszt_app.c:31268
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
uint32_t DRV_TMR1_PeriodValueGet(void)
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
TIMER_DATA TIMER
static void DRV_TMR3_Tasks(void)
Definition: inszt_app.c:4006
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
static void Decode_Manchester(void)
uint16_t current
Definition: inszt_app.c:28456
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE bufferHandle
Definition: inszt_app.c:29446
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
uint8_t timer1_100uS_count
Definition: inszt_app.c:30384
void Prepare_Dwn_Msg(uint8_t Identifier, uint8_t Cmd, uint8_t Msg_Length)
Definition: fsk.c:227
uint32_t DRV_TMR4_PeriodValueGet(void)
float float32_t
Definition: inszt_app.c:28410
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
static void DRV_TMR4_Open(void)
Definition: inszt_app.c:4055
SYSTEM_OKAY_STATES state
Definition: inszt_app.c:30951
bool sensor_offset_tick
Definition: inszt_app.c:28472
bool DRV_IC0_BufferIsEmpty(void)
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
FSK_STATES
Definition: fsk.h:53
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
uint8_t cnt_preamble
Definition: inszt_app.c:29415
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
uint16_t voltage
Definition: inszt_app.c:28639
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
uint8_t configValue
Definition: inszt_app.c:30502
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
bool timer1_1000mS_tick
Definition: inszt_app.c:30383
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
void DRV_TMR4_StopInIdleDisable(void)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
void DRV_USART0_TasksTransmit(void)
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
bool DRV_TMR0_Start(void)
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
Definition: inszt_app.c:4066
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
COMM_STATES state
Definition: commmodule.h:81
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
void DRV_TMR1_CounterClear(void)
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
DRV_HANDLE tmrDrvHandle
Definition: inszt_app.c:30378
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
int QQQfcn_ptr_num
Definition: inszt_main.c:151
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
HVPS_STATES
Definition: inszt_app.c:28227
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
bool new_voltage_flag
Definition: inszt_app.c:28648
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_ERROR_LEVEL gblErrLvl
DRV_SPI_TASK_MODE
Definition: inszt_app.c:26335
static void DRV_TMR0_Open(void)
Definition: inszt_app.c:3615
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
static void Read_WL_CPS_V_I(void)
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
static void DRV_TMR3_DeInitialize(void)
Definition: inszt_app.c:3925
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
static void Execute_Protocol_B(void)
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
Definition: inszt_app.c:13520
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_BUFFER_RESULT
Definition: inszt_app.c:15009
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
Definition: inszt_app.c:31340
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
S4_COMMAND S4_state
Definition: inszt_app.c:27775
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
static void DRV_TMR0_DeInitialize(void)
Definition: inszt_app.c:3595
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
UART_DATA UART
Definition: inszt_UART.c:28399
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
static void Check_WL_CPS_Over_Current(void)
static void ValidateComm(void)
void DRV_ADC0_Open(void)
uint8_t dump_fire_count
Definition: inszt_app.c:27673
S5_COMMAND
Definition: inszt_app.c:27754
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
bool timer1_10mS_tick
Definition: inszt_app.c:30381
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
int QQQindicator
Definition: inszt_main.c:104
void PLIB_DMA_Enable(DMA_MODULE_ID index)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
uint8_t timer_complete
Definition: inszt_app.c:29421
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
Definition: inszt_app.c:3956
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
TFifo RX_FIFO
Definition: fifo.c:47
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
FSK_DATA FSK
Definition: fsk.c:71
uint8_t timer_count
Definition: inszt_app.c:29420